Creation of semi-transparent filled polygons?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have relatively little experience in Dot Net graphics.

I have a picturebox with a background image. For the purpose of this
application it is necessary to draw polygons (both filled and outline only)
to emphasize parts of the image. It would probably be better if the
background image remained at least partly visible.

Is there any simple way to generate a semi-transparent filled polygon?
 
Just draw the shape you like with a brush that has an alpha component.

//in the Paint handler...
SolidBrush b=new SolidBrush(Color.FromArgb(128,Color.Red));
e.Graphics.FillRectangle(10,10,100,150);

HTH.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml
 
Perfect. Thanks!

(Things have changed a little since I learned how to draw lines in
TurboPascal class.)
 
Back
Top