FreeImage_SavePNG
FreeImage_SavePNG Filename$, ImageIndex
 
Parameters:

    Filename$ = The name and path of the output file
    ImageIndex = The Index of the image you wish to save
Returns: NONE
 

      The FreeImage_SavePNG function uses the FreeImage library to save an image out to disc in PNG format.


     

FACTS:

      * The PNG saver defaults to 32bit ARGB for best compatibility.



Mini Tutorial:


      This example includes the library, creates a gradient image then saves it out to disk.

  
  
  // include the Free Image library
  #Include "FreeImage"
  
  // Make an image with a gradient on it for something to save
  ThisImage=NewImage(800,600,2)
  RenderToImage ThisImage
  ShadeBox 0,0,800,600,$FF,$FF,$112233,$112233
  RenderToScreen
  DrawImage ThisIMage,0,0,false
  
  
  
  // save name of file
  SaveName$="C:\Saved_Image.png"
  
  // display the name of the save file
  Print SAveName$
  
  // save this image as a file
  FreeImage_SavePNG(SaveName$,ThisImage)
  
  // check if the file saved,  as windows may prevent it
  // from saving to the C:  drive
  If FileExist(SaveName$)
     
     // Display the size of the file
     Print "Size:"+Str$(FileSize(SaveName$))
  EndIf
  
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  
  
  




 
Related Info: FreeImage_LoadImage | FreeImage_SaveBMP | FreeImage_SaveJPG | LoadImage :
 


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