FreeImage_SaveBMP
FreeImage_SaveBMP Filename$, ImageIndex, [Compression =0]
 
Parameters:

    Filename$ = The name and path of the output file
    ImageIndex = The Index of the image you wish to save
    [Compression =0] = Compression flag. 0 = no compression , 1 run length compression
Returns: NONE
 

      The FreeImage_SaveBMP function uses the FreeImage library to save an image out to disc in BMP format. The saver has an optional compression parameter, so you can select if you want the output image to compressed or not.

     Valid Compression Parameter:

00 = No compression
01 = Run length compression


      The saver only gives two compression modes, it's either OFF or has run length enabled. Run length compression really only suits images with lots of consequtive colours in it. For busy images such as photos it's generally not worth using it.



FACTS:


      * None



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
  Filename$="C:\Saved_Image.bmp"
  
  
  For lp =0 To 1
     
   ; compute name of output with different compression
   ; modes
     SaveName$=Replace$(FileName$,".",Str$(lp)+"."     )
     
   ; display the name of the save file
     Print SAveName$
     
     
   ; save this image as a file
     FreeImage_SaveBMP(SaveName$,ThisImage, lp)
     
   ; 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
     
  Next
  
  
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  
  
  




 
Related Info: FreeImage_LoadImage | FreeImage_SaveJPG | FreeImage_SavePNG | LoadImage :
 


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