Mercurial > hg > forks > multipaint-js
diff exporters.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 | 4161d798cb64 |
children | 517348a7b543 |
line wrap: on
line diff
--- a/exporters.pde Fri Jul 06 00:45:31 2018 +0300 +++ b/exporters.pde Fri Jul 06 01:05:31 2018 +0300 @@ -1214,30 +1214,24 @@ } -PImage mpRenderImageWithBorder() +PImage mpRenderImage(bool border) { - //output the visible graphics as image - //with border - //processing style - PImage output = createImage( - X * g_omag + g_bordh * g_omag, - Y * g_omag + g_bordv * g_omag, - RGB); - - mpRenderToImageAt(output, int((g_bordh * g_omag) / 2), int((g_bordv * g_omag) / 2)); + PImage output; - return output; -} - + if (border) + { + pimage = createImage( + X * g_omag + g_bordh * g_omag, + Y * g_omag + g_bordv * g_omag, + RGB); -PImage mpRenderImageWithoutBorder() -{ - //output the visible graphics as image - //processing style - //without border - PImage output = createImage(X * g_omag, Y * g_omag, RGB); - - mpRenderToImageAt(output, 0, 0); + mpRenderToImageAt(output, int((g_bordh * g_omag) / 2), int((g_bordv * g_omag) / 2)); + } + else + { + output = createImage(X * g_omag, Y * g_omag, RGB); + mpRenderToImageAt(output, 0, 0); + } return output; }