DrawingBufferPixelFormat()

Syntax

Result = DrawingBufferPixelFormat()
Description
Returns the pixel format of the current output.

Parameters

None.

Return value

The result can be a combination (with bitwise or) of the following flags:
  #PB_PixelFormat_8Bits      : 1 byte per pixel, palletised
  #PB_PixelFormat_15Bits     : 2 bytes per pixel 
  #PB_PixelFormat_16Bits     : 2 bytes per pixel
  #PB_PixelFormat_24Bits_RGB : 3 bytes per pixel (RRGGBB)
  #PB_PixelFormat_24Bits_BGR : 3 bytes per pixel (BBGGRR)
  #PB_PixelFormat_32Bits_RGB : 4 bytes per pixel (RRGGBB)
  #PB_PixelFormat_32Bits_BGR : 4 bytes per pixel (BBGGRR)
  #PB_PixelFormat_ReversedY  : The Y-Coordinate of the output is reversed in memory (the bottom row is stored first).

Remarks

DrawingBuffer() must be called before using this function.

Example

The following examples show how to handle the result:
  If DrawingBufferPixelFormat() = #PB_PixelFormat_32Bits_RGB | #PB_PixelFormat_ReversedY
    ; 32-bit RGB with reversed Y coordinate
  EndIf
  
  If DrawingBufferPixelFormat() = #PB_PixelFormat_32Bits_RGB
    ; 32-bit RGB without reversed Y coordinate
  EndIf
  
  If DrawingBufferPixelFormat() & #PB_PixelFormat_32Bits_RGB
    ; 32-bit RGB, with or without reversed Y coordinate
  EndIf
  

See Also

StartDrawing(), DrawingBufferPitch()

Supported OS

All

<- DrawingBufferPitch() - 2DDrawing Index - DrawingFont() ->