Click to See Complete Forum and Search --> : This is probably really easy and simple but i still cant do it. (says a lot about me)
Lead
Oct 29th, 2000, 01:54 PM
Hi
I have a form that users draw shapes on with the line method (much like MS Paint) but i am wondering how to fill shapes in.
I remember a command in QuickBasic called PAINT(x,y) that allowed you to fill shapes in. Is there an equivalent of this in VB or another method of doing it?
I hope someone out there can help
Thanks
Lead
Hi.
I'm working on a project similar to yours and I had to face the same problem.
If you wish to automatically fill closed shapes(circles, rectangles and polygons) AS THEY ARE DRAWN, then you simply need to use the Createbrush API. (If you do not know about APIs, there is a nice tutorial on the index page of this site). Creating a brush and assigning it to your picturebox or form using the SelectOject API will do that. Every closed shape will be filled in with the created brush as they are drawn.
If you need to fill shapes AFTER they are drawn, then take a look at the Extfloodfill API. This will fill the region from the clicked point in all directions until either a pixel of a different colour is in the way or if the surface your are filling chages colour along the way.
I hope this helps you a bit. I'll check once and a while for replies, so just post in a new thread and I'll do my best.
They've all helped me here to create my app, so it's my turn now!
Good luck!
Lead
Oct 30th, 2000, 12:29 PM
Hi
Thanks, the extfloodfill api is what i need.
Lead
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.