BlitImageAlphaMultColour
BlitImageAlphaMultColour ThisImage, Xpos, Ypos, BlendColour
 
Parameters:

    ThisImage = The Index of the image you wish to draw
    Xpos = The X coordinate to draw this image
    Ypos = The Y coordinate to draw this image
    BlendColour = The RGB Colour to blend this surface while it's being drawn
Returns: NONE
 

     BlitImageAlphaMultColour is similar to the DrawImage function, except it has post processing. What it does, is it draws your selected image, but it also performs a Alpha Colour Multiply on the image with your selected colour.

      To create equivalent functionality you'd have to uses Sprites Tint mode, or a pair of images. First you'd draw the primary image to a temp image, then you'd apply the Alpha Mult over the copy by drawing a BOX with an AlphaMult InkMode over it. Once it's tinited, you draw the colourized version to the required destination. But, BlitImageAlphaMultColour is a lot easier !


      The combined processing is not just to save you a few lines of code, it's actually a more optimal way of performing this action.



FACTS:


     * BlitImageAlphaMultColour is only intend for drawing FX or AFX formatted surfaces.

     * BlitImageAlphaMultColour doesn't support mask & alpha channel transparency.



 
Example Source: Download This Example
; Inlude the Blit Image functions
  #Include "BlitImage"
  
; Create an FX image the size of the screen
  MyImage=NewFXImage(GetScreenWidth(),GetScreenHeight())
  
  
; fill the backdrop with something so we can see it
  Tile=LoadNewFxImage("..\../Media/bg22.jpg")
  
  
  Col=$c090d0
  
  ScreenVsync on
  
; Start of Demo loop
  Do
     
   ; Bump Angle, we'll use to the move the colour in a sine wave
     
     Angle#          =WrapAngle(Angle#,1)
     ColourLevel     =60+CosRadius(angle#,40)
     Colour          =RGBFade(Col,ColourLevel)
     
   ; Check if the left mouse button is pressed
   ; if it is, then set COL to a random colour value
     If LeftMouseButton() Then Col=RndRGB()
     
     
   ; Draw a screen full of scrolling tiles
     RenderToImage MyImage
     TileImage Tile,Xpos,0,false
     RenderToScreen
     Xpos++
     
     
   ; This function does a combined Blit (copy) our Image with
   ; Alpha Colour Multiplication.  The Alpha Mult allows us to
   ; Tint (colourize) the image while it's being drawn, without
   ; changing the original image. MAking it ideal for screen
   ; fading.
     
     BlitImageAlphaMultColour(MyIMage,0,0,Colour)
     
     
   ; Display Message
     Ink RGB(255,0,255)
     
     Text 0,0,"Using BlitImageAlphaMultColour to tint"
     Text 0,20,"Left Mouse to change tint colour"
     
   ; flip the back buffer to the front, so the user can see it
     Sync
     
  Loop
  
  
 
Related Info: BlitImageAlpha50Colour | BlitImageAlphaAddColour | BlitImageAlphaSubColour | BlitImageClear | Box | DrawAlphaImage | DrawImage | InkMode :
 


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