how to draw irregular shape and calculate its surface?

  • Thread starter Thread starter Uwe Conradi
  • Start date Start date
U

Uwe Conradi

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
 
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.
 
Back
Top