nBpp = MImgGetBpp( hImage )

Gets an image's color depth ( Bpp = Bits per pixel ).

Parameters
hImage
Number: Handle of the image

Return
Number: The color depth if successful or 0 if an error occurs

Example
In this example the color depth of an image is prompted to the user:

Set nBpp = MImgGetBpp( hImage )
Select Case nBpp
  Case 0
    Set sText = "Error"
    Break
  Case 1
    Set sText = "Monochrome"
    Break
  Case 4
    Set sText = "16 colors"
    Break
  Case 8
    Set sText = "256 colors"
    Break
  Case 24
    Set sText = "True color"
    Break
Call SalMessageBox( sText, "Color depth", MB_IconAsterisk | MB_IconOk )

See also
MImgSetBpp


  
  

 

Created with the Personal Edition of HelpNDoc: Free Web Help generator