GetImageFileName$
Filename$ = GetImageFileName$(ImageIndex)
 
Parameters:

    ImageIndex = The Image you wish to query
Returns:

    Filename$ = The Filename$ of the loaded image
 

      GetImageFilename$ will return the filename$ (if any) of the selected image. It's important to understand that this command will only work with images that were created using a Load Image command. So using it on images create via CreateIMage or GetImage (for example) will only return an empty string.

     This can be useful in working out what images have been loaded. So you can cache your images if need be.



FACTS:


     * Can only return the Filename from images loaded with the load image commands (ie. LoadImage,LoadNewImage etc ).

     * The returned filename$ (if any) will be the absolute path of the file. See the GetFileName$, GetFileExt$ and GetFolderName$ for separating the name field if required.




Mini Tutorial:


      This example is sample code only. It requires a valid image filename in order to work, as such it's not cut and paste friendly.


  
; Work out the location of the Media folder
; within the help files
  path$=ProgramDir$()+"\Help\Commands/Media/"
  
; Load the 'ship.bmp' Image File from the
; help files folder
  LoadImage Path$+"ship.bmp",1
  
; Display this images filename
  Print GetImageFileName$(1)
  
; Draw the image to the screen
  DrawImage 1100,100,false
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  



This example would output.

  
  C:My Programs\PlayBASIC\Help\Commands/Media/
  







 
Related Info: GetImageStatus | LoadFxImage | LoadImage | LoadNewImage :
 


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