Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Imaging With QuickDraw /
Chapter 3 - QuickDraw Drawing / QuickDraw Drawing Reference
Routines / Calculating Black-and-White Fills


SeedFill

To determine how far filling will extend from a seeding point, use the SeedFill procedure.

PROCEDURE SeedFill (srcPtr,dstPtr:\xDDPtr; 
                    srcRow,dstRow,height,words,
                    seedH,seedV:\xDDInteger);
srcPtr
A pointer to the source bit image.
dstPtr
On input, a pointer to the destination bit image; upon return, a pointer to the bitmap containing the resulting mask.
srcRow
Row width of the source bitmap.
dstRow
Row width of the destination bitmap.
height
Height (in pixels) of the fill rectangle.
words
Width (in words) of the fill rectangle.
seedH
The horizontal offset (in pixels) at which to begin filling the destination bit image.
seedV
The vertical offset (in pixels) at which to begin filling the destination bit image.
DESCRIPTION
The SeedFill procedure produces a mask showing where bits in an image can be filled from a starting point, like the paint pouring from the MacPaint paint-bucket tool. The SeedFill returns this mask in the dstPtr parameter. This mask is a bitmap filled with 1's only where the pixels in the source image can be filled. This is illustrated in
Figure 3-24. You can then use this mask with the CopyBits, CopyMask, and CopyDeepMask procedures.

Figure 3-24 A source image and its resulting mask produced by the SeedFill procedure


Point to the bit image you want to fill with the srcPtr parameter, which can point to the image's base address or a word boundary within the image. Specify a pixel height and word width with the height and words parameters to define a fill rectangle that delimits the area you want to fill. The fill rectangle can be the entire bit image or a subset of it. Point to a destination image with the dstPtr parameter. Specify the row widths of the source and destination bitmaps (their rowBytes values) with the srcRow and dstRow parameters. (The bitmaps can be different sizes, but they must be large enough to contain the fill rectangle at the origins specified by the srcPtr and dstPtr parameters.) Figure 3-25 illustrates these parameters for the source and destination bit images.

You specify where to begin filling with the seedH and seedV parameters: they specify a horizontal and vertical offset in pixels from the origin of the image pointed to by the srcPtr parameter. The SeedFill procedure calculates contiguous pixels from that point out to the boundaries of the fill rectangle, and it stores the result in the bit image pointed to by the dstPtr parameter.

Calls to SeedFill are not clipped to the current port and are not stored into QuickDraw pictures.

Figure 3-25 Parameters for the SeedFill and CalcMask procedures


SEE ALSO
For color graphics ports, use the SeedCFill procedure, which is described in the chapter "Color QuickDraw."


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996