Yes - I did notice this, but was at a bit of a loss for how to implement.
I'm trying to divide a single large image up into a bunch of smaller ones, with some bevel effects (think jigsaw pieces).
data = sourceRaster.getImageData(g_rect);
targetRaster.setImageData(data, g_point);
// the 'light' part of the bevel
ctx.globalCompositeOperation = 'lighter';
ctx.drawImage(strokeRaster.canvas, 0, 1);
// the 'dark' part of the bevel
ctx.globalCompositeOperation = 'source-atop';
ctx.drawImage(strokeDkRaster.canvas, 0, 0);
// the mask of the piece shape
ctx.globalCompositeOperation = 'destination-in';
ctx.drawImage(maskRaster.canvas, 0, 0);
return targetRaster;
Would any of the above be better accomplished using items and blendModes?
Also - is there a way to create a 'blank' Raster of a certain size without having a source image?
Cheers,
r o b