Important: The information in this document is obsolete and should not be used for new development.
SeedCFill
To determine how far filling will extend to pixels matching the color of a particular pixel, use theSeedCFill
procedure.
PROCEDURE SeedCFill (srcBits,dstBits: BitMap; srcRect,dstRect: Rect; seedH,seedV: Integer; matchProc: ProcPtr; matchData: LongInt);
srcBits
- The source image. If the image is in a pixel map, you must coerce its
PixMap
record to aBitMap
record.dstBits
- The destination mask.
srcRect
- The rectangle of the source image.
dstRect
- The rectangle of the destination image.
seedH
- The horizontal position of the seed point.
seedV
- The vertical position of the seed point.
matchProc
- An optional color search function.
matchData
- Data for the optional color search function.
DESCRIPTION
TheSeedCFill
procedure generates a mask showing where the pixels in an image can be filled from a starting point, like the paint pouring from the MacPaint paint-bucket tool. TheSeedCFill
procedure returns this mask in thedstBits
parameter. This mask is a bitmap filled with 1's to indicate all pixels adjacent to a seed point whose colors do not exactly match theRGBColor
record for the pixel at the seed point. You can then use this mask with theCopyBits
,CopyMask
, andCopyDeepMask
procedures.You specify a source image in the
srcBits
parameter, and in thesrcRect
parameter you specify a rectangle within that source image. You specify where to begin seeding in theseedH
andseedV
parameters, which must be the horizontal and vertical coordinates of a point in the local coordinate system of the source bitmap. By default, the 1's returned in the mask indicate all pixels adjacent to the seed point whose pixel values do not exactly match the pixel value of the pixel at the seed point. To use this default, set thematchProc
andmatchData
parameters to 0.In generating the mask,
SeedCFill
uses theCopyBits
procedure to convert the source image to a 1-bit mask. TheSeedCFill
procedure installs a default color search function that returns 0 if the pixel value matches that of the seed point; all other pixel values return 1's.The
SeedCFill
procedure does not scale: the source and destination rectangles must be the same size. Calls toSeedCFill
are not clipped to the current port and are not stored into QuickDraw pictures.You can customize
SeedCFill
by writing your own color search function and pointing to it in thematchProc
procedure;SeedCFill
will then use your procedure instead of the default. You can use thematchData
parameter for whatever you'd like. In thematchData
parameter, for instance, your application could pass the handle to a color table. Your color search function could then check whether the pixel value for the pixel currently under analysis matches any of the colors in the table.SEE ALSO
See "Application-Defined Routine" on page 4-92 for a description of how to customize theSeedCFill
procedure.