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 ?
| ||
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. |
| ||
There is a PNG saver DLL in the code archives. It's far from perfect but might suffice for what you want. |
| ||
thanks, ill take a look :) |
| ||
looks like the link is broken... |
| ||
Try again here. |
| ||
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.. |
| ||
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 |
| ||
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. |
| ||
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! |
| ||
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 |