Solved

FloodFill Api

Posted on 1997-11-19
1
300 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now