?
Solved

Draw smaller polygon inside larger one

Posted on 2006-07-03
2
Medium Priority
?
299 Views
Last Modified: 2010-04-23
These are points for a 5x sided polygon, Im using "g.DrawPolygon(Pens.Black, some_Points)" to draw it on the screen. In my program they change whenever you resize or move the polygon.
70, 160
150, 100
280, 100
280, 230
70, 230

How should I draw a smaller dotted line around the inside edge of this polygon? I realise I can use g.DrawPolygon again but I cant think of a way to work out the new points for the inside shape :)

If a picture helps, Im trying to draw the inner dashed line kind of like this:
http://i65.photobucket.com/albums/h219/photocosi/testroof2.png

0
Comment
Question by:craigdev
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Accepted Solution

by:
omegaomega earned 2000 total points
ID: 17035378
Hello, Craig,

I would try creating a GraphicsPath object from the points of your polygon.  (See the AddPolygon method of the GraphicsPath object.)  Then you could use the Transform method to scale and translate the path into the new size and position.

Cheers,
Randy
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question