Tao.Sdl SDK Documentation

SdlImage.IMG_isPNM Method 

Test for valid, supported PNM file.

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

Parameters

src

Return Value

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

Remarks

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

Binds to C-function in SDL_image.h

            int IMG_isPNM(SDL_RWops *src)
            

Example

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

See Also

SdlImage Class | Tao.Sdl Namespace | IMG_LoadTyped_RW