|
-
Aug 3rd, 2003, 12:56 PM
#1
Thread Starter
Fanatic Member
[Resolved] ExtFloodFill
Hi There!
Does anyone know how to do a floodfill in VB .NET?
The app is like this:
I have a black and white image that I have scanned.
Then you select a color, click anywhere on the image, and the shape is filled.
Just like an old-style colouringbook.
I have found a routine to capture the screen, and I can make a floodfill on that image
without problems, and have that image displayed in a picturebox.
Then I figured it would be easy. Just replace the desktop DC with my image DC
using
VB Code:
hDc = MyGraphics.GetHdc.ToInt32
But then I just end up with a black
rectangle covering my entire image.
It seems that the GetHdc doesnt return the right DC, for the image/bitmap.
This is really frustrating, especially since I know that all my API's work, if I just have the right DC's.
Please help... I'm making this app for my son, and he will be very disapointed if I can't get this to work.
BTW. I have also tried to make a recursive function, that set's
a pixel, then checks the surrounding pixels, and set's them if they
have the right color, then calls it'self for the next pixel and so on.
That also works, but only with small images.
If the image is too large then i get a stackoverflow exception.
Last edited by pax; Aug 4th, 2003 at 03:02 AM.
I wish I could think of something witty to put in my sig...
...Currently using VS2013...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|