Results 1 to 7 of 7

Thread: Paint [Resolved (FLOODFILL!)]

Threaded View

  1. #1

    Thread Starter
    Fanatic Member Ruku's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    655

    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:
    1. 'Dim p As New Region(New Rectangle(x, y, x + 1, y + 1))
    2.                     'Dim newFillMode As System.Drawing.Drawing2D.FillMode = System.Drawing.Drawing2D.FillMode.Alternate
    3.                     'Buffer.FillRegion(MyPen.Brush, p)
    4.  
    5.                     Dim Point1 As New PointF(x, y)
    6.                     Dim Point2 As New PointF(x + 1, y)
    7.                     Dim Point3 As New PointF(x, y + 1)
    8.                     Dim Point4 As New PointF(x + 1, y + 1)
    9.                     Dim pF As PointF() = {Point1, Point2, Point3, Point4}
    10.  
    11.                     'Buffer.FillPolygon(MyPen.Brush, pF, Drawing2D.FillMode.Winding)
    12.  
    13.                     Dim i As New System.Drawing.Drawing2D.GraphicsPath(pF, Nothing)
    14.                     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.

    Using VB.NET 2005/.NET 2.0, NetBeans IDE 5, Fujitsu Cobol85,
    Website: http://DreamForgery.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width