Mercurial > hg > forks > multipaint-js
changeset 228:c9a77d87e380
Cleanup.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 05 Sep 2018 22:28:15 +0300 |
parents | 2d424d096281 |
children | 4f26dc75c448 |
files | files.pde |
diffstat | 1 files changed, 3 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/files.pde Wed Sep 05 22:21:18 2018 +0300 +++ b/files.pde Wed Sep 05 22:28:15 2018 +0300 @@ -158,26 +158,8 @@ } -// bordh/v = 64, 32, omag = 1 -void mpSavePNGImage(String name, int fmt, boolean border, int bordh, int bordv, int omag) +boolean mpImportAnyImage(PImage simg) { - PImage simg = mpRenderImage(border, bordh, bordv, omag); -// if (g_data[int('Q')] == 0) - - if (simg !== null) - { - // XXX TODO .. actually save the image, something like .. - //simg.canvas.toBlob(function(idata){ mpSaveBinaryFile(name, idata); }, "image/png", 0.95); - } -} - - -int mpLoadPNGImage(String name) -{ - PImage simg = null; - if (simg == null) - return -1; - int lefth = g_farge; int righth = g_backg; storeparameters(); @@ -187,7 +169,7 @@ g_data[int('b')] = 1; //old IQ if (!mpImportFromImage(simg)) - return -2; + return false; restoreparameters(); refreshpalette(); @@ -195,7 +177,7 @@ g_boxreconstruct = 2; selectcolor(0, lefth); selectcolor(1, righth); - return 0; + return true; }