Tao.Sdl SDK Documentation |
|
SdlImage.IMG_LoadTGA_RW Method
Load a .TGA image.
[Visual Basic]
Public Shared Function IMG_LoadTGA_RW( _
ByVal
src As
IntPtr _
) As
IntPtr
Parameters
-
src
- The BMP image is loaded from this
Return Value
a pointer to the image as a new SDL_Surface. NULL is returned on errors, like if BMP is not supported, or a read error.
Remarks
Load src as a TGA image for use as a surface, if TGA support is compiled into the SDL_image library. If you try to load a non TGA image, you might succeed even when it's not TGA image formatted data, this is because the TGA has no magic, which is a way of identifying a filetype from a signature in it's contents. So be careful with this.
Binds to C-function in SDL_image.h
SDL_Surface *IMG_LoadTGA_RW(SDL_RWops *src)
Example
// load sample.tga into image
SDL_Surface *image;
SDL_RWops *rwop;
rwop=SDL_RWFromFile("sample.tga", "rb");
image=IMG_LoadTGA_RW(rwop);
if(!image)
{
printf("IMG_LoadTGA_RW: %s\n", IMG_GetError());
// handle error
}
See Also
SdlImage Class | Tao.Sdl Namespace | IMG_LoadTyped_RW