Windows Develop Bookmark and Share   
 index > Windows Forms Sample Applications > programming code that lets you draw a polygon using visual basic?
 

programming code that lets you draw a polygon using visual basic?

how does one programme? can anyone tell me how to code for this i want to be able to draw a polygon with my mouse i.e once someone clicks the draw button on the form then they can draw a polygon. also i want to be able to read and write this to file. and draw a point in the polygon as well as calculate the x, y co-ordinates of the point and the vertices of the polygon when the user clicks calculate on the form then this value must show. also i want an area calculation of my polygon so how do I code this function so that when the user clicks the caculate area button on my form the area of the polygon that the user has drawn is calculated. Also i want to be able to draw lines and let the user draw lines and calculate the x, y co-ordinates of the line crossing the polygon i.e the point of intersection between the line the user has drawn and the polygon the user has drawn. Does anybody have any idea how to do this. coding in Visual basic. so basically when the user clicks the draw polygon button on the form they can draw the polygon and a line if they want to, draw a point in the polygon, as well as have a function that calculates the co-ordinates of the polygon, the area of the polygon and the co-ordinates of the point of intersection between the polygon and the line all using visual basic thanks
mrsdewinter2  Monday, May 19, 2008 1:37 PM

Hi mrsdewinter2,

Based on my understanding, you need to use GDI+ to paint the polygon yourself. Please refer to the following article:

· http://www.codeproject.com/KB/vb/Interpolations.aspx

For more information about GDI+, please check the following page:
http://www.codeproject.com/KB/books/1861004990.aspx
http://www.codeproject.com/KB/GDI-plus/GDI_.aspx
http://www.codeproject.com/KB/GDI-plus/gdi_plus_code_generator.aspx

Hope this helps.
Best regards.
Rong-Chun Zhang

Windows Forms General FAQs
Windows Forms Data Controls and Databinding FAQs

Rong-Chun Zhang  Friday, May 23, 2008 12:18 PM

Hi mrsdewinter2,

Based on my understanding, you need to use GDI+ to paint the polygon yourself. Please refer to the following article:

· http://www.codeproject.com/KB/vb/Interpolations.aspx

For more information about GDI+, please check the following page:
http://www.codeproject.com/KB/books/1861004990.aspx
http://www.codeproject.com/KB/GDI-plus/GDI_.aspx
http://www.codeproject.com/KB/GDI-plus/gdi_plus_code_generator.aspx

Hope this helps.
Best regards.
Rong-Chun Zhang

Windows Forms General FAQs
Windows Forms Data Controls and Databinding FAQs

Rong-Chun Zhang  Friday, May 23, 2008 12:18 PM

You can use google to search for other answers

Custom Search

More Threads

• Terrarium Server Temporary Difficulties
• Direct SQL instead of webservice
• Is there an IssueVision guide?
• Terrarium servers around the world?
• fotovision panels
• Cannot uninstall TaskVision
• does taskvision work on win pro 2k
• Trying to find WebBrowserSamples
• What is the data member when using a stored procedure?
• why seprate block for instrumentation in enterprise library 4.0 or later