# HG changeset patch # User Matti Hamalainen # Date 1535541011 -10800 # Node ID 06d3840b15ae594c9c6f192d5d159a52a83bd331 # Parent 823672f83ae9d6c701c7fc8024da0b7c131ba250 Implement PNG export, via Ctrl + click on (format) export icon. It is a bit difficult to trigger, though. Will have to explore better ways later. diff -r 823672f83ae9 -r 06d3840b15ae events.pde --- a/events.pde Wed Aug 29 14:08:05 2018 +0300 +++ b/events.pde Wed Aug 29 14:10:11 2018 +0300 @@ -955,7 +955,8 @@ message("ERROR!"); } - if (g_data[int('E')] == 1) { + if (g_data[int('E')] == 1) + { g_data[int('E')] = 0; // message("Export SRC|is disabled"); @@ -1006,7 +1007,22 @@ if (g_data[int('W')] == 1) { g_data[int('W')] = 0; - if (g_formatext != "") { + + if (g_control) + { + message("PNG|export"); + + String fname = filename +"_"+ (g_spare ? "spare" : "main") +".png"; + PImage simg = mpRenderImage(true, 64, 32, 1); + + if (simg !== null) + { + simg.sourceImg.toBlob(function(idata){ mpSaveBinaryBlob(fname, idata); }, "image/png", 0.95); + } + } + else + if (g_formatext != "") + { message("Format|export"); String fname = filename +"_"+ (g_spare ? "spare" : "main") +"."+ g_formatext;