SaveImage - attempt to make it faster - Printable Version +- QB64 Phoenix Edition (https://staging.qb64phoenix.com) +-- Forum: QB64 Rising (https://staging.qb64phoenix.com/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://staging.qb64phoenix.com/forumdisplay.php?fid=3) +---- Forum: Utilities (https://staging.qb64phoenix.com/forumdisplay.php?fid=8) +---- Thread: SaveImage - attempt to make it faster (/showthread.php?tid=1253) |
SaveImage - attempt to make it faster - mnrvovrfc - 12-09-2022 This is the "SaveImage" routine from the Wiki, changed by me to try to make it faster, but it seems to be a failure with big pictures. For stuff larger than 1920x1080 might have to set even greater string buffers for "d$" and "r$". It was quite fast on my old Toshiba laptop purchased in December 2006 with 1024x768 resolution. The "DIM" declarations are to ensure it works in "OPTION _EXPLICIT" mode. !Needs testing! Code: (Select All) ''from QB64 wiki RE: SaveImage - attempt to make it faster - SMcNeill - 12-09-2022 Let me introduce you to SaveImage: Save Image v2.3d (qb64phoenix.com) It saves full screens. Partial screens. Text or Graphic screens. In BMP, PNG, GIF, or JPG format. You can set 256 Color Images to "Best Palette" or "QB64 Palette". It's fast, efficient, easy to use, and has passed the test of time on all platforms. What more do you need from a SaveImage library? Usage is more or less as simple as: Code: (Select All) '$INCLUDE:'SaveImage.BI The extension you specify for your filename is enough for the library to decided what file type to save for you. "My Pic.JPG" saves a jpg file. "My Pic.BMP" saves it in BMP format. Same for GIF or PNG.. If you only need to save part of the screen, or a different image than the one that is the current _SOURCE, then just call: result = SaveImage(file$, imagehandle, x1, y1, x2, y2) The SaveImage function works with screen portions, as well as specified screens/images, and returns success/failure results through the Function for you, in case there's some issue where the image won't save properly for you. RE: SaveImage - attempt to make it faster - mnrvovrfc - 12-09-2022 I'll keep my version but this one is better. Thank you. RE: SaveImage - attempt to make it faster - grymmjack - 12-27-2022 (12-09-2022, 11:17 AM)SMcNeill Wrote: Let me introduce you to SaveImage: Save Image v2.3d (qb64phoenix.com) Hey does this save ANS colored text? ASCII text? RE: SaveImage - attempt to make it faster - SMcNeill - 12-28-2022 It converts your text screens to graphic screens automagically and then saves them for you. RE: SaveImage - attempt to make it faster - mnrvovrfc - 12-29-2022 This library does not however do animated GIF. But it's easy enough to arrange it using GIMP and enough patience. |