Newbie: GDI fill function? RRS feed

  • Question

  • User-227644360 posted
    Hi all.

    I'm just learning ASP.NET (coming from classic asp background). Reading ASP.NET Unleased 2nd Ed. Flicking through the book chapter 27 talks about GDI commands, fillrectangle, draw etc.

    I've got a black and white map of Europe - All the countries are white except for a black outline, Eg england, france, germany etc.
    In my database I have the following


    Now, the X, Y are pixel locations that point to a location within the country, and color is text (red, green etc)

    What I want to do is FILL AREA, I can't find this command in the book.

    How can I fill each country area starting at the X,Y point?

    Thanks for any help.


    Thursday, July 7, 2005 3:20 AM

All replies

  • User639471876 posted
    I think you can manage that using fillPolygon. You shoud provide an array of Points that are the vertexes of the area you want.
    Thursday, July 7, 2005 8:09 AM
  • User-227644360 posted



    I thought about that, but thats a lot of points stored in the db or a lot of "straight" lines. There is a control that I use in classic ASP called ASPPainter. If I can't do it through ASP.net normal GDI features then I'll have to purchase this control.

    Just in case anyone else is interested:




    Thursday, July 7, 2005 10:27 AM
  • User1152494133 posted

    This functionality is not part of the Framework as a single method.  As stated above, if you stored the region data, or created a method to determine the region, then you can use the appropriate Fill method.

    However, you might find the source code for Paint.NET useful to see how they implemented the FloodFill algorithm for the PaintBucketTool.


    Thursday, July 7, 2005 3:36 PM
  • User-227644360 posted
    Thanks for that link Jason.

    I'll download it when I get home tonight and have a look.

    Friday, July 8, 2005 6:11 AM