|
LoadFxImage | |
LoadFxImage Filename$, ImageNumber | |
Parameters: Filename$ = The Filename and path of the image you wish to load ImageNumber = The Image Number where you wish to store this picture data |
|
Returns: NONE | |
LoadFxImage reads an picture file from disc into PlayBasics image memory. You must provide this command with the full folder path and filename of the image you wish to load, as well as a free (not currently in use) image index. LoadFxImage is an named alternate to using the LoadImage function and setting the Format parameter to 2 (FX format). Eg LoadImage Filename$,Index,2 is functionality the same as LoadFxImage Filename$,Index , some programmers just prefer to use the FX version for code readability. FACTS: * LoadFxImage supports various popular image formats including BMP, TGA JPEG, PNG as well PlayBASIC very own Image Format called PBI * Images loaded with LoadFxImage are stored in your computers System memory (FX format). The FX format doesn't support Alpha Channel. If you need Alpha either use LoadAFXImage or optional format parmeter in LoadImage to tell PB what format the image should be loaded in. * FX formatted images are most suitable for real time rotation and pixel related effects. They also withstand breaks in service from your operating system, such as, when the user presses ALT-TAB, or when the OS decides to hibernate while your program is running. Which would destroy images stored in Video Memory. * LoadFxImage does not change PlayBASIC current graphics output. So if you want to redirect drawing operations onto a freshly loaded image, you'll have to do this manually with RenderToImage command. * LoadFxImage (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 be automatically loaded from the resource buffer. See #AddResource and look at the LoadNewImage command for an example. * Note: We highly recommended you read the Images tutorials also! Mini Tutorial: This examples loads an image from disc into image slot (index) #1 in memory, displays it to the screen at position 100x,100y, then waits for the user to press a key before ending.
|
|
Example Source: Download This Example
|
Related Info: | CreateFxImage | CreateFxImageEx | CreateImage | DeleteImage | DrawImage | GetFreeImage | LoadImage | LoadNewFXImage | LoadNewImage | NewFxImage | NewImage | RenderToImage | SaveBitmap : |
|
|||||||||||||||||||||||||||||||||||||||
(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com |