Solved

Draw smaller polygon inside larger one

Posted on 2006-07-03
2
285 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
2 Comments
 
LVL 12

Accepted Solution

by:
omegaomega earned 500 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now