LoadNewFXImage
ImageIndex = LoadNewFXImage(Filename$)
 
Parameters:

    Filename$ = The Filename and path of the image you wish to load
Returns:

    ImageIndex = The Image Index where this picture data was load to
 

      LoadNewFXImage reads an image file from disc into your computers memory. Unlike LoadFXImage all you need to provide LoadNewFXImage is the path and filename of the image. It will return the ImageIndex for you.



FACTS:


      * LoadNewFXImage supports various popular image formats including BMP, TGA JPEG, PNG as well PlayBASIC very own Image Format called PBI

      * LoadNewFXImage does not change PlayBASIC current graphics output. So if you want to redirect drawing operations to an image, you'll have to do this manually with RenderToImage.

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

      * LoadNewFXImage (and variants) can now load PBI / BMP / TGA + PNG's files directly from memory. To do so, the address of the data is given as a String in place of the filename with an & symbol prefix. eg LoadImage "&"+Str$(Ptr),Index - They can also automatically loaded as resources. See #AddResource





Mini Tutorial:


      This examples loads an image from disc into a free image index, displays it to the screen at 100x,100y then waits for the user to press a key before ending


  
; Load an image into image slot #1
  MyImage=LoadNewFxImage("ThePictureYouWishToLoad.bmp")
  
; Draw the Loaded image to the screen
  DrawImage MyImage,100,100,0
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  




 
Example Source: Download This Example
; Init a variable FileName$ to store the
; location and name of the image we wish to load
  FileName$="..\../Media/bubble_64x64.bmp"
  
; Load this file into PBs Image Bank and return a handle to it
  MyImage=LoadNewFxImage(Filename$)
  
; draw this image to the screen
  DrawImage MyImage,350,200,false
  
; Display the screen and wait for a key press
  Sync
  WaitKey
  
  
  
  
 
Related Info: CreateImage | DeleteImage | DrawImage | LoadImage | LoadNewImage | NewImage | RenderToImage | SaveBitmap :
 


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