GetFreeImage
freeImageIndex = GetFreeImage()
 
Parameters: NONE
Returns:

    freeImageIndex = The Index value of a Image that is currently not in use
 

      The GetFreeImage function returns the Index of an image that is currently NOT in use. This is particularly useful when you wish to dynamically request and use image media when needed. This can take the burdon of managing what image indexes are currently free, completely off the users shoulders, an hides it away inside PlayBASIC.




FACTS:


      * Also See NewImage, NewFxImage, LoadNewImage for dynamic creation of the Image Media.




Mini Tutorial:


      Requesting a free image index, the create this image, draw some random dots to it, then display the image on the screen.

  
  
  
; Ask PlayBASIC for the Image Index that is currently free for use.
  MyImage=GetFreeImage()
  
; Create this image of size 200x*100y
  CreateImage MyImage,200,100
  
; Redirect all drawing operations to this image
  RenderToImage MyImage
  
; Draw some random dots to this image
  For lp=0 To 100
     Dot Rnd(200),Rnd(100)
  Next
  
; Redirect all drawing operations to the SCREEN.
  RenderToScreen
  
; Draw My Image to the screen..
  DrawImage MyImage,50,50,true
  
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  
  





 
Related Info: CreateImage | DeleteImage | LoadFxImage | LoadImage | LoadNewImage | NewFxImage | NewImage :
 


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