Creating an 'erase' brush
Posted: 2006-12-21T15:23:46-07:00
Hi there,
I'm 'drawing' on an image, like thus
what i'd like to do is 'erase' part of what i've drawn, i tried this
but that didn't work of course.. i really just need to be able to set some pixels on my 'drawing' as transparent before applying them back to the main image, .. any suggestions?
I could create a new image with my 'erase' pen, and then apply that as a transparency mask, but i'm having some trouble finding out how to do that as well.
I'm 'drawing' on an image, like thus
Code: Select all
DrawSetStrokeColor($drawing,$pixel);
DrawSetStrokeWidth($drawing,$thickness);
DrawSetStrokeAlpha($drawing,$opacity);
DrawSetStrokeLineCap($drawing, MW_RoundCap);
DrawSetStrokeLineJoin($drawing, MW_RoundJoin);
DrawSetFillOpacity($drawing,1);
DrawLine($drawing, 0, 0, 200, 200);
MagickDrawImage($source,$drawing);
Code: Select all
DrawLine($drawing, 0, 0, 200, 200);
//set the stroke to transparent
DrawSetStrokeAlpha($drawing,0);
DrawLine($drawing, 0, 200, 200, 0);
I could create a new image with my 'erase' pen, and then apply that as a transparency mask, but i'm having some trouble finding out how to do that as well.