NewFxImage
ImageIndex = NewFxImage(Width, Height, [AFXFlag=0])
 
Parameters:

    Width = The width of the image in pixels
    Height = The Height of the image in pixels
    [AFXFlag=0] = Flag to toggle AFX mode. When AFXFlag=1 the function will create an AFX image
Returns:

    ImageIndex = The Index of the newly created image
 

     The NewFxImage() function creates a blank FX image in memory and returns this new images index for you.



FACTS:


      * FX Images created via NewFxImage are depth compatibile with the current screen display mode. So if the program is running on a 16bit screen mode, then the image will also be 16bit. You can manually create FX images of any depth using CreateFxIMageEx, but not Video images. AFX formatted images are 32bit regardless.

      * NewFxImage creates an FX image does not change PlayBASIC current graphics output. So if you want to redirect all drawing operations to a newly created image, you'll have to do this manually via RenderToImage.


     * NewFxImage is an alternative to using the NewImage function with the optional format parameter. So we can create FX images either way, but some people prefer not to use optional / format parameters with NewImage in their code as they feel it's help with code readability.


      * Note: We highly recommended you read the Images & Sprites tutorials also!




Mini Tutorial:


      This example creates a new Image in memory, renders some graphics to it, then it draws this image to the screen.


  
; Create a new image
  MyImage=NewFXImage(200,200)
  
; Tell PB to Render all graphics to this image
  RenderToImage MyImage
  
; Draw some dots to this image
  For lp =0 To 1000
     DotC Rnd(200),Rnd(200),RndRGB()
  Next
  
; Tell PB to now render all graphics directly to the screen
  RenderToScreen
  
; Draw the image to the screen at position 300x,100y
  DrawRotatedImage  MyImage,300,100,45,1,1,0,0,true
  
; Display the Screen and wait for the user to press a key
; before ending
  Sync
  WaitKey
  




 
Related Info: CreateFxImage | CreateFxImageEx | CreateImage | DeleteImage | DrawImage | GetFreeImage | LoadAFxImage | LoadFxImage | LoadImage | LoadNewAFxImage | LoadNewFXImage | LoadNewImage | NewImage | PrepareAFXimage | PrepareFXimage | RenderToImage :
 


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