Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

FloodFill Api

Posted on 1997-11-19
1
Medium Priority
?
347 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 8

Accepted Solution

by:
mrmick earned 120 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

705 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