how to draw irregular shape and calculate its surface?

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
 
D

DickGrier

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top