RenderToImage
RenderToImage ImageIndex
 
Parameters:

    ImageIndex = The Index of the number you wish to draw to
Returns: NONE
 

      RenderToImage will make PlayBASIC direct it's drawing operations such as Text, Graphics, Images, Sprites, Maps etc to the Image rather than the screen.



FACTS:


      * When drawing is being redirected to an image, you'll have to draw that image to the screen in order to see any changes.

      * Image 0 is the screen. So passing RenderToImage an ImageIndex of zero (RenderToImage 0) is the same RenderToScreen.




Mini Tutorial:


      This example Creates a temp image, redirects all draw to the newly create image, renders some circles on that image, restores rendering back to the screen, draws the image to the screen and then refreshes the screen so we can see it.

  
; Make an Image 200x by 300y in size
  CreateImage 1,200,300
  
; Tell PB to redirect all drawing commands to an image
; and not the screen..
  RenderToImage 1
  
; Draw some random circles on image #1
  For lp=1 To 100
     Circle Rnd(200),Rnd(300),Rnd(10) ,Rnd(1)
  Next lp
  
; Redirect ALL Drawing to the BACK Screen
  RenderToScreen
  
; Clear the Screen to a blue colour
  Cls RGB(0,0,255)
  
; Draw image #1 (the one we just created) to the screen
  DrawImage 1,300,100,0
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  
  
  
  


 
Related Info: GetSurface | RenderToScreen | Sync :
 


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