| |
|
| |
How to Make Proper Borders Around ShapesExplains how to get shapes with borders.Say I want a blue rectangle with a red border around it. One might assume I would simply call:
Rectangle rectangle = new Rectangle(0, 0, 10, 10);
graphics.DrawRectangle(Pens.Red, rectangle);
graphics.FillRectangle(Brushes.Blue, rectangle);
But noooo - that would be too logical. The result is stupid - a rectangle with half a border.
Apparently the "fix" for this is to simply swap the order of the draw and fill:
Rectangle rectangle = new Rectangle(0, 0, 10, 10);
graphics.FillRectangle(Brushes.Blue, rectangle);
graphics.DrawRectangle(Pens.Red, rectangle);
| |
|
All content copyright 1996-2008 by Linda Naughton O'Meara unless otherwise noted.
Shadowrun is a copyright and trademark of WizKids, LLC.
Earthdawn is a copyright and trademark of FASA Corporation.
Crimson Skies is a copyright and trademark of Microsoft Corporation.
Babylon 5 is a copyright and trademark of Time Warner Entertainment.
Battlestar Galactica is a copyright of Sci Fi / Universal.
Any use of characters, names, places, etc. from these systems is done with the greatest respect for their creators, and is not intended as a challenge to any copyrights or trademarks.
| |