Solved

FloodFill Api

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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…
Suggested Courses
Course of the Month11 days, 11 hours left to enroll

623 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