FadeImage
FadeImage ImageIndex, FadePercent#
 
Parameters:

    ImageIndex = The Index of image you wish to fade
    FadePercent# = The percentage to fade the image
Returns: NONE
 

     FadeImage will change the brightness of all of the pixels in an image.



FACTS:


     * Fade Percentages should range between 0 and 100. Going outside of that range, may give unexpected results.

     * FadeImage uses a destructive process, meaning the pixel information in the image is changed after fading.

     * FadeImage algorithm simply multiples each separate A, R, G, B components of each pixel colour with the percentage converted to scalar.

      Ie.
  
  
  ThisPixel =Point(xlp,ylp)
  
  NewA = RgbA(ThisPIXEL)*Scaler#
  NewR = RgbR(ThisPIXEL)*Scaler#
  NewG = RgbG(ThisPIXEL)*Scaler#
  NewB = RgbB(ThisPIXEL)*Scaler#
  
  DotC Xlp,ylp, ARGB(NewA,NewR,NewG,NewB)
  



 
Example Source: Download This Example
; Load the common ship image from the media folder in the help
  MyImage = LoadNewImage(ProgramDir$()+"Help/Commands/Media/ship.bmp")
  
  
; Clear the Screen to a bright blue colour
  Cls RGB(0,0,255)
  
; Draw our previously created image to the screen
  DrawImage MyImage,300,100,0
  
; Fade the Image so it's 50 percent of it's original brightness
  FadeImage MyImage,50
  
; Now Render the newly faded image to the screen, bellow the original.
  DrawImage MyImage,300,200,0
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  
  
  
  
 
Related Info: BlurImage | GrayScaleImage | LightImage | MirrorImage | RenderPhongImage | RGBmaskImage | ScrollImage :
 


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