GetImageMaskColour
ColourRGBValue = GetImageMaskColour(ImageIndex)
 
Parameters:

    ImageIndex = The Image you wish to query
Returns:

    ColourRGBValue = The transparent colour of the image in 24bit RGB format
 

     GetImageMaskColour() reads an images transparent (mask) colour.



FACTS:


     * Images by default have a transparent colour mask of zero rgb(0,0,0)

     * The returned colour will be in 32bit ARGB format, even if the Image is only 16Bit. %AAAAAAAARRRRRRRRGGGGGGGGBBBBBBBB. See RGBA, RGBR,RGBG,RGBB to isloate the A, R,G,B levels of the colour.




Mini Tutorial:


The example creates an image, set it's mask colour to RGB(0,0,255) (a bright blue colour), display it then reads the images transparent colour..

  
  
; First Create an image, colour it blue and draw a red circle on it..
  size = 200
  Img=NewImage(Size,Size)
  RenderToImage Img
  Cls RGB(0,100,255)
  CircleC Size/2,Size/2,size/2,1,RGB(255,0,0)
  
; Set the Images Mask Colour (it's transparent colour) to Rgb(0,100,255) blue
  ImageMaskColour Img,RGB(0,100,255)
  
; redirect all drawing to the Screen
  RenderToScreen
  
; Clear the Screen to a dark greeny colour
  Cls RGB(30,50,40)
  
;  Draw this image as a solid image.
  DrawImage Img,100,100,false
  
;  Draw this image as a transparent image.
  DrawImage Img,400,100,true
  
  
;Display This images MASK COLOUR
  TransparentColour=GetImageMaskColour(Img)
  Print "Images Transparent colour is:"+Str$(TransparentColour)
  Print "Transparent Colours R:"+Str$(RgbR(TransparentColour))
  Print "Transparent Colours G:"+Str$(RgbG(TransparentColour))
  Print "Transparent Colours B:"+Str$(RgbB(TransparentColour))
  
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  
  
  
  



This example would output.

  
  Images Transparent colour is  25855
  Transparent Colours R: 0
  Transparent Colours G: 100
  Transparent Colours B: 255
  

 
Related Info: ARGB | ImageMaskColour | Images | RGB | RGBmaskImage :
 


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