Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / October 2004

Tip: Looking for answers? Try searching our database.

Creation of semi-transparent filled polygons?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
B. Chernick - 30 Sep 2004 03:51 GMT
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?
Bob Powell [MVP] - 30 Sep 2004 09:02 GMT
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.

Signature

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

> I have relatively little experience in Dot Net graphics.
>
[quoted text clipped - 4 lines]
>
> Is there any simple way to generate a semi-transparent filled polygon?
B. Chernick - 01 Oct 2004 02:49 GMT
Perfect.  Thanks!

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

> Just draw the shape you like with a brush that has an alpha component.
>
[quoted text clipped - 13 lines]
> >
> > Is there any simple way to generate a semi-transparent filled polygon?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.