SaveBitmap
SaveBitmap Filename$, ImageIndex
 
Parameters:

    Filename$ = The Filename of the image/image
    ImageIndex = The screen or image index that you wish to save. (0=screen, 1 or higher = image)
Returns: NONE
 

     SaveBitmap Saves the Screen or Image as a 32bit Windows Bitmap file.


      Image parameters

           0 = Save the screen
           1 or higher = Save an Image




FACTS:


      * SaveBitmap is a user function and is part of the "SaveBitmap" library. Therefore, to enable this command, you'll need to include the library into your project. Eg #Include "SaveBitmap"

      * SaveBitmap saves the image/screen as 32bit raw (none compressed) bitmap file.

      * The FreeImage library contains various image saving functions for popular formats such as BMP, PNG and JPEG.





Mini Tutorial:


      This example, draws some circles to the screen, saves it to the C drive and loads it back.


  
  
; Include the Save Bitmap library into this project
  #Include "SaveBitmap"
  
; clear the screen to  some random colour
  Cls RndRGB()
  
; disable thje break key, so you can't exit until the demo is complete
  BreakKey off
  
; draw soem random circles to screen
  For lp =0 To 100
     CircleC Rnd(800),Rnd(600),Rnd(50),true,RndRGB()
  Next
  
; The filename of the image were going to save
  Filename$="c:\TestSave.bmp"
  
; save the Screen (image 0 = screen)
  SaveBitmap(Filename$,0)
  
; reload the saved bitmap as image #1
  LoadImage Filename$,1
  
; Display the image
  DrawImage 1,0,300,0
  
; Refres the screen so the user can see it
  Sync
  
; wait for a key press before ending
  WaitKey
  
; delete the temp saved image from the C drive
  DeleteFile Filename$
  




This example would output.

  
  no Text output
  




 
Related Info: CreateFxImage | CreateFxImageEx | CreateImage | LoadFxImage | LoadImage | LoadNewImage | NewFxImage | NewImage :
 


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