Tao.Sdl SDK Documentation

SdlImage.IMG_isJPG Method 

Test for valid, supported JPG file.

[Visual Basic]
Public Shared Function IMG_isJPG( _
   ByVal src As IntPtr _
) As IntPtr
[C#]
public static IntPtr IMG_isJPG(
   IntPtr src
);

Parameters

src

Return Value

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

Remarks

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

Binds to C-function in SDL_image.h

            int IMG_isJPG(SDL_RWops *src)
            

Example

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

See Also

SdlImage Class | Tao.Sdl Namespace | IMG_LoadTyped_RW