PageType Example VB

This example uses the PageType property to determine the page type of the image specified in the Image property.

Private Sub cmdPageType_Click()
    'Reads the PageType property to determine the page type of
    'the image specified in the Image property
    Dim strImgPageType As String
    
    'Read the PageType property and translate the value to a
    'corresponding string.
    Select Case ImgEdit1.PageType
      Case 1
        strImgPageType = "Black and White"
      Case 2
        strImgPageType = "4 bit grayscale"
      Case 3
        strImgPageType = "8 bit grayscale"
      Case 4
        strImgPageType = "4 bit palettized"
      Case 5
        strImgPageType = "8 bit palettized"
      Case 6
        strImgPageType = "24 bit RGB"
      Case 7
        strImgPageType = "24 bit BGR"
    End Select
        
    'Display the page type on a form for
    'informational purposes, or to allow it to be modified.
    frmInfo.lblImgInfo(1).Caption = strImgPageType
End Sub