|
-
Dec 15th, 2005, 07:59 PM
#1
Thread Starter
Fanatic Member
Paint [Resolved (FLOODFILL!)]
Let's say I got a black circle drawned on a bitmap object, in the middle of a white background...
How do I paint the black circle to red...
Don't tell me to paint another circle over it... , I'm looking for a way to paint a single color from a specifyed point to another color...
I don't really feel like going through each pixel... it's my last resort, but my guess is that there is something out there way easier... right?
I've tried...
VB Code:
'Dim p As New Region(New Rectangle(x, y, x + 1, y + 1))
'Dim newFillMode As System.Drawing.Drawing2D.FillMode = System.Drawing.Drawing2D.FillMode.Alternate
'Buffer.FillRegion(MyPen.Brush, p)
Dim Point1 As New PointF(x, y)
Dim Point2 As New PointF(x + 1, y)
Dim Point3 As New PointF(x, y + 1)
Dim Point4 As New PointF(x + 1, y + 1)
Dim pF As PointF() = {Point1, Point2, Point3, Point4}
'Buffer.FillPolygon(MyPen.Brush, pF, Drawing2D.FillMode.Winding)
Dim i As New System.Drawing.Drawing2D.GraphicsPath(pF, Nothing)
Buffer.FillPath(MyPen.Brush, i)
Plenty of crap that always returned the same kind of result:
I got a square and it just does the same as clearing the section to another color...
HEEEEKO
Last edited by Ruku; Dec 26th, 2005 at 10:26 PM.
-
Dec 15th, 2005, 08:15 PM
#2
Re: Paint
You use a Brush object in order to fill in shapes...
Here's a link to sample code in filling in shapes..
http://www.vbdotnetheaven.com/Code/Aug2003/2152.asp
-
Dec 15th, 2005, 08:26 PM
#3
Thread Starter
Fanatic Member
Re: Paint
yeah, I know that... ok, look at attachement for a better idea of what I want...
so basically, to fill a color with another... stopping at another color's touch...
-
Dec 17th, 2005, 09:46 PM
#4
Thread Starter
Fanatic Member
-
Dec 18th, 2005, 10:13 AM
#5
Re: Paint [Unresolved]
So you basically want a floodfill routine then?
Google "FloodFill Algorithm"
I don't live here any more.
-
Dec 19th, 2005, 04:30 AM
#6
Re: Paint
 Originally Posted by gigemboy
Hi gigemboy,
Great link thanks!
Wkr,
sparrow1
-
Dec 21st, 2005, 01:24 AM
#7
Thread Starter
Fanatic Member
Re: Paint [Unresolved]
 Originally Posted by wossname
So you basically want a floodfill routine then?
Google "FloodFill Algorithm"
hehe, alright, so I really don't have any choice but to go through each pixel then... , I'll like it up
thx for keywords!
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
|