PrepareFXimage
PrepareFXimage ImageNumber
 
Parameters:

    ImageNumber = The index identifier of this image
Returns: NONE
 

      PrepareFXimage convert an image into a pixel format that can be used with real time effects like Alpha Blending and Rotation.


      We highly recommended you read the Images and Sprites tutorials




FACTS:


      * FX formatted images are stored in system memory. This image format doesn't preserve Alpha Channel even in 32bit pixel depths. See PrepareAFXImage for that.

      * The conversion process isn't real fast, so it's best to load the image in FX format directly, if you can.


 
Example Source: Download This Example
; Create an Image of a Circle
  Size=120
  CreateImage 1,Size,Size
  RenderToImage 1
  Cls RndRGB()
  
; Prepare Image 1 so that it can be used in Real time effects like
; rotation and alpha blending
  PrepareFXImage 1
  
; redirect All drawing to the Screen.
  RenderToScreen
  
; Start a loop
  Do
     
   ; Clear the screen to black
     Cls RGB(60,40,30)
     
   ; Read the mouses position
     mx#=MouseX()
     my#=MouseY()
     
   ; Draw Message at the mouse position
     CenterText mx#+(size/2),my#+(size/2),"DrawAlphaImage"
     
     
   ; Alpha Blend our image over the top of the text message
     DrawAlphaImage 1,mx#,my#,SinNewValue(75,angle#,25)/100,false
     
     angle#=WrapAngle(angle#,5)
     
   ; Display the screen and loop until the users presses the ESC key.
     Sync
  Loop
  
  
 
Related Info: CreateFxImage | CreateFxImageEx | DrawAlphaImage | DrawRotatedImage | LoadFxImage | NewFxImage :
 


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