Hi, is there a way that we can save a specific surface with this rather than just the screen in html5 please? :) Thank you
GameMaker & Construct 2 plugins to let user pick where to save screenshot(s). · By
This extension uses a trick involving drawing the GM canvas onto another canvas to get base64 of it, but surfaces are not canvases on WebGL.
I think your best bet would be to grab pixels using buffer_get_surface, then grab a raw buffer object (Uint8Array I think? Or maybe ArrayBuffer) using buffer_get_address, then convert those pixels into ImageData, then putImageData it onto canvas, and then you can finally get base64 of it and use the rest of the existing code.
Thanks for your reply. I tried some way, maybe the problem is at my end, but could not get it work.
Surface_save works well on windows.exe (but not with html5), however buffer_get_surface+buffer_save or buffer_get_surface+buffer_base64_encode+file_text_write_string did not work at all.
Anyway, thank you.