FragReaper
asked on
Visual Basic .Net find image on bitmap
In code, I retrieve a bitmap that has been drawn with on a picturebox by the user. This drawing is a white background with black pen, and can be of any size within the bounds of the picturebox. What I need to do first is remove all the excess whitespace around the bitmap. The way I have been doing this has been to run an iteration through every pixel of the bitmap, looking for black, and recording these co-ordinates. With the bitmap being at least 300 x 120 pixels this iteration takes time, around 6 minutes on this PC. I need:
A) a more efficient way to find the useful part of the image on the bitmap.
B) a way to move this part of the image to a new bitmap
A) a more efficient way to find the useful part of the image on the bitmap.
B) a way to move this part of the image to a new bitmap
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!
You gave me the idea to call a Sub that recorded the limits of the drawing as it was created, this meant I didn't have to process the image to find the unused space.
You gave me the idea to call a Sub that recorded the limits of the drawing as it was created, this meant I didn't have to process the image to find the unused space.
you can find sample over here.
http://msdn.microsoft.com/en-us/library/5ey6h79d.aspx