Solved

FloodFill Api

Posted on 1997-11-19
1
311 Views
Last Modified: 2008-03-17
is it possible to floodfill an area bounded by more than one colour ?
Please give an example please
0
Comment
Question by:never
1 Comment
 
LVL 8

Accepted Solution

by:
mrmick earned 30 total points
ID: 1441617
Add the declare and use the procedure below...

Declare Function ExtFloodFill Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal crColor As Long, ByVal wFillType As Long) As Long

Sub FloodFill(PicObj As PictureBox, FillColor As Long, x As Long, y As Long)
Const FLOODFILLBORDER& = 0  'The fill area is bounded by the
                            'color specified by the FillColor
                            'parameter.

Const FLOODFILLSURFACE& = 1 'The fill area is defined by the
                            'color that is specified by FillColor.
                            'Filling continues outward in all
                            'directions as long as the color is
                            'encountered. This style is useful for
                            'filling areas with multicolored
                            'boundaries.

   Dim RC As Long 'Return Code

   PicObj.FillStyle = vbSolid ' = 0
   PicObj.FillColor = FillColor
   RC = ExtFloodFill(PicObj.hDC, x, y, 0&, FLOODFILLSURFACE)

End Sub

0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question