QPix v2.2x

An image database step by step


Chapter index | Step: 1 - 2 - 3 - 4 - 5 - 6

Step 2: Test an image file on disk


Images are usually coming from disk files. To start working on a disk file that contains an image, an "image file", we need to know its full pathname. Then we should make sure it contains image data that can be handled by QPix.

To do this we will use QPx_TestImageFile:

    `Test a file for valid image data

    C_LONGINT($error)
    C_TEXT($imagePath) `Full pathname to the image file
    C_STRING(4;$imageType) `Image type
    C_BOOLEAN($validImage) `Is the file a valid image?

    $imagePath:="C:\images\image.psd"
    $imageType:=""
    $validImage:=False

    $error:=QPx_TestImageFile($imagePath;$imageType)

    If ($error=qpx_noErr)

      $validImage:=($imageType#"") `$imageType now contain the image type

    End if

    If ($validImage)

     `Work with the valid image

    End if

Goto Step 3