[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.2.9 IMG_isPNG

int IMG_isPNG(SDL_RWops *src)

src

If the PNG format is supported, then the image data is tested to see if it is readable as a PNG, otherwise it returns false (Zero).

Returns: 1 if the image is a PNG and the PNG format support is compiled into SDL_image. 0 is returned otherwise.

 
// Test sample.png to see if it is a PNG
SDL_RWops *rwop;
rwop=SDL_RWFromFile("sample.png", "rb");
if(IMG_isPNG(rwop))
	printf("sample.png is a PNG file.\n");
else
	printf("sample.png is not a PNG file, or PNG support is not available.\n");

See Also:
3.1.3 IMG_LoadTyped_RW



This document was generated on January, 24 2006 using texi2html