PC Review


Reply
Thread Tools Rate Thread

how to draw irregular shape and calculate its surface?

 
 
Uwe Conradi
Guest
Posts: n/a
 
      6th May 2010
Hello everybody,
I load first some image in the picturebox.
I would like to draw (with pressed mouse) a line in the picturebox making
so an irregular shape and then to color this shape and finally to calculate
how many pixel are there. So I could compare different shapes.
How to make it?
Thanks for your ideas!
Uwe

 
Reply With Quote
 
 
 
 
Cor Ligthert[MVP]
Guest
Posts: n/a
 
      7th May 2010
Have a look at the System.Drawing probably 10.000 samples on Internet how
to draw a line in an image.

http://msdn.microsoft.com/en-us/libr...m.drawing.aspx

"Uwe Conradi" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello everybody,
> I load first some image in the picturebox.
> I would like to draw (with pressed mouse) a line in the picturebox making
> so an irregular shape and then to color this shape and finally to
> calculate how many pixel are there. So I could compare different shapes.
> How to make it?
> Thanks for your ideas!
> Uwe


 
Reply With Quote
 
DickGrier
Guest
Posts: n/a
 
      7th May 2010
To calculate the surface area, the normal approach would be to break the
irregular shape into a large number of rectangles, each of small size (often
very small). Calculate the area of each rectangle, then sum all of those
areas.

This is a standard technique, and while not exact -- such a calculation
never can be exact, unless you have a mathematical formula that describes
the surface, if the rectangles are sufficiently small, the error also will
be small.

Dick

--
Richard Grier, Consultant, Hard & Software 12962 West Louisiana Avenue
Lakewood, CO 80228 303-986-2179 (voice) Homepage: www.hardandsoftware.net
Author of Visual Basic Programmer's Guide to Serial Communications, 4th
Edition ISBN 1-890422-28-2 (391 pages) published July 2004, Revised July
2006.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Irregular Shape - Follow up Geoff Microsoft Excel Programming 0 17th Jun 2008 04:01 PM
Irregular Shape Geoff Microsoft Excel Programming 17 7th Jun 2008 09:15 AM
Changing the shape of user control surface Lorenzo Microsoft VB .NET 1 19th Mar 2008 11:39 AM
Draw PDF onto GDI+ Surface Richard MSL Microsoft Dot NET Framework Forms 2 3rd Mar 2008 03:43 PM
Custom control clipping (irregular shape) ppyrstr Microsoft C# .NET 2 15th Sep 2003 05:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:11 PM.