News:

PlayBASIC2DLL V0.99 Revision I Commercial Edition released! - Convert PlayBASIC programs to super fast Machine Code. 

Main Menu

save image to disk

Started by skip, November 10, 2010, 04:30:23 PM

Previous topic - Next topic

how to save screen to the d drive when you pick the save screen tile

help
0 (0%)
save screen
0 (0%)

Total Members Voted: 0

Voting closed: November 20, 2010, 04:30:23 PM

skip

how to save image to d: drive when you pick the save tile

kevin

#1
    I honestly don't understand your question.  You can save to any device (provided the OS gives you write access), by just giving it the full absolute path.

  ie.

   To save a file called "Test1.txt" to the "D" drive in folder "MyStuff" -     we'd make join this together like so.

     FileToSave$= "D:\MyStuff\test1.txt"

 
  As for saving an image here's the savebitmap from the Help.


PlayBASIC Code: [Select]
   ; 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 some 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)

;
Print "Press Any Key To Load Saved Image"
Sync
waitkey
waitnokey


; reload the saved bitmap as image #1
LoadImage Filename$,1

; Display the image
DrawImage 1,0,300,0

; Refresh 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$