Can i take a screenshot and save it NOT as BMP ?

Blitz3D Forums/Blitz3D Beginners Area/Can i take a screenshot and save it NOT as BMP ?

Insane Games(Posted 2003) [#1]
I made a simple stuff here so the player can take screen-shots, but its a little slow (takes some time to save the image) and the image is really big ! (like 1.37Mbs)
Is there another faster and better way to take screenshots ?
Saving as .PNG would be really better.

Thanx.


Beaker(Posted 2003) [#2]
There is a PNG saver DLL in the code archives. It's far from perfect but might suffice for what you want.


Insane Games(Posted 2003) [#3]
thanks, ill take a look :)


Insane Games(Posted 2003) [#4]
looks like the link is broken...


Beaker(Posted 2003) [#5]
Try again here.


Insane Games(Posted 2003) [#6]
thanks. Working fine now. The delay to take the screen shot still there, but now we have PNG images.
Too bad only the DLLs takes more than 500kbs..


Ginger Tea(Posted 2003) [#7]
i dont think you can avoid the delay
infact using image compression probably adds to the time

the image is compressed on disc only
once its on screen the screen is a 24/32bit uncompressed bitmap


(tu) sinu(Posted 2003) [#8]
how about saving the image to a temp file then on exit print them out.
when i was trying a demo where the player walked around the level taking photo's this way was a nightmare with slight pause all the time. Instead i made it so pictures were saved on level exit.


Myke-P(Posted 2003) [#9]
Any storage of a full screen of pixels for saving now, or later will result in a delay.

Now then, store the minimal information you need to **recreate the same screen on-exit** and you might be talking a couple of hundred bytes rather than a couple of hundred Kb!


Mathieu A(Posted 2003) [#10]
look at this!

Function screenshot()
if keyhit(88)

temps_depart_capture = MilliSecs()
iFileNumber% = 0
Repeat
iFileNumber = iFileNumber + 1
sFileName$ = "Captures\Screenshot" + String$("0", 3 - Len(Str$(iFileNumber))) + iFileNumber + ".bmp"
Until Not(FileType(sFileName))
SaveBuffer FrontBuffer(), sFileName
G_temps_de_pause = MilliSecs() - temps_depart_capture

endif
End Function