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 theSeedCFillprocedure.
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
PixMaprecord to aBitMaprecord.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
TheSeedCFillprocedure 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. TheSeedCFillprocedure returns this mask in thedstBitsparameter. This mask is a bitmap filled with 1's to indicate all pixels adjacent to a seed point whose colors do not exactly match theRGBColorrecord for the pixel at the seed point. You can then use this mask with theCopyBits,CopyMask, andCopyDeepMaskprocedures.You specify a source image in the
srcBitsparameter, and in thesrcRectparameter you specify a rectangle within that source image. You specify where to begin seeding in theseedHandseedVparameters, 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 thematchProcandmatchDataparameters to 0.In generating the mask,
SeedCFilluses theCopyBitsprocedure to convert the source image to a 1-bit mask. TheSeedCFillprocedure 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
SeedCFillprocedure does not scale: the source and destination rectangles must be the same size. Calls toSeedCFillare not clipped to the current port and are not stored into QuickDraw pictures.You can customize
SeedCFillby writing your own color search function and pointing to it in thematchProcprocedure;SeedCFillwill then use your procedure instead of the default. You can use thematchDataparameter for whatever you'd like. In thematchDataparameter, 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 theSeedCFillprocedure.