Mercurial > hg > forks > multipaint-js
diff multipaint.pde @ 94:6e74d45ea620
More work towards jpeg/png image export/import.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 06 Jul 2018 01:05:31 +0300 |
parents | aadcd5f7e9dc |
children | 2d4b56e4d966 |
line wrap: on
line diff
--- a/multipaint.pde Fri Jul 06 00:45:31 2018 +0300 +++ b/multipaint.pde Fri Jul 06 01:05:31 2018 +0300 @@ -311,15 +311,16 @@ } -void mpSavePNGImage(String name) +void mpSavePNGImage(String name, int fmt, bool border) { - PImage simg; - if (g_data[int('Q')] == 0) - simg = mpRenderImageWithoutBorder(); - else - simg = mpRenderImageWithBorder(); + PImage simg = mpRenderImage(border); +// if (g_data[int('Q')] == 0) - // XXX TODO .. actually save the image + if (simg !== null) + { + // XXX TODO .. actually save the image, something like .. + //simg.canvas.toBlob(function(idata){ mpSaveBinaryFile(name, idata); }, "image/png", 0.95); + } }