Hey all. I need to make a polygon within an image have a border, but other than that be completely transparent. I've figured out a way to do this, but am not sure if there is an easier way:
thanks,
-kh
// assume a 500x500 image in the variable layerImage
MagickColor tmpTransparent = new MagickColor(255, 255, 255);
List<Drawable> drawables = new List<Drawable>();
drawables.Add(new DrawableStrokeColor(Color.Black));
drawables.Add(new DrawableStrokeWidth(1));
drawables.Add(new DrawableFillColor(tmpTransparent));
drawables.Add(new DrawablePolygon( ... ); // <- polygon details left out
layerImage.Draw(drawables);
layerImage.Transparent(tmpTransparent);
Essentially, fill the polygon with an unused color, then later use the .Transparent() method to make all pixels of that color "transparent". Is there a better way?thanks,
-kh