BitsPerPixel Property

Returns the bits per pixel of the specified image. Read-only Long.

expression.BitsPerPixel

*expression   * Required. An expression that returns an Image object.

Example

The following example returns the properties, including bits per pixel, of the first image in the active document.

Sub TestImageProperties()

  Dim img As MODI.Image
  Dim strImageInfo As String
  
  Set img = miDoc.Images(0)
  
  strImageInfo = "Bits per pixel: " & img.BitsPerPixel & vbCrLf & _
    "Compression: " & img.Compression & vbCrLf & _
    "Pixel height: " & img.PixelHeight & vbCrLf & _
    "Pixel width: " & img.PixelWidth & vbCrLf & _
    "Horizontal DPI: " & img.XDPI & vbCrLf & _
    "Vertical DPI: " & img.YDPI
  MsgBox strImageInfo, vbInformation + vbOKOnly, _
    "Image Information"
  
  Set img = Nothing

End Sub

Applies to | Image Object