GetImageDepth
Depth = GetImageDepth(ImageIndex)
 
Parameters:

    ImageIndex = The Image you wish to query
Returns:

    Depth = The Colour Depth of this image
 

      The GetImageDepth function returns the Colour Depth of a selected image.


Depth values = colour formats


15Bit = RGB Colour format 555 (each pixel is a word (2bytes))
16Bit = RGB Colour format 565 (each pixel is a word (2bytes))
24Bit = RGB Colour format 888 (each pixel is 3 bytes)
32Bit = RGB Colour format -888 (each pixel is a Long/Integer (4bytes))





FACTS:


      * By Default images have the same Depth as the current display mode. GetScreenDepth

 
Example Source: Download This Example
; Note: this demo opens a 32bit screen mode.
  OpenScreen 800,600,32,2
  
  
;Clear the Screen to Blue
  Cls RGB(0,0,255)
  w=200
  h=400
  Print "32 bit Screen Mode"
  
  
; create a 15bit (555) FX buffer
  CreateFXImageEx 1,w,h,15
  
; create a 16bit (565 ) FX buffer
  CreateFXImageEx 2,w,h,16
  
; create a 24bit (888 RGB) FX buffer
  CreateFXImageEx 3,w,h,24
  
; create a 32bit (8888 - ARGB) FX buffer
  CreateFXImageEx 4,w,h,32
  
  
  c1=$ff0000
  c2=$00ff00
  c3=$0000ff
  
  For lp=0 To 100
     x1=Rnd(w)
     y1=Rnd(h)
     x2=Rnd(w)
     y2=Rnd(h)
     x3=Rnd(w)
     y3=Rnd(h)
     
     For Img=1 To 4
        RenderToImage Img
        GouraudTri x1,y1,c1,x2,y2,c2,x3,y3,c3
     Next
     
  Next
  
  RenderToScreen
  For Img=1 To 4
     x=(w+10)*(img-1)
     y=100
     DrawImage img,x,y,0
     Text x,y,Str$(GetImageDepth(img))+" bit"
  Next
  
; display screen and wait for a key to be pressed
  Sync
  WaitKey
  
  
  
  
  
 
Related Info: CreateImage | DeleteImage | DrawImage | GetFreeImage | GetImagePitch | GetImagePtr | LoadImage | NewImage | PrepareFXimage | RenderToImage :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com