Fill method (Main Control)

C++ Builder example

Delphi example

 

Builder Syntax

int Fill (int crFill);

Delphi Syntax

Fill (crFill:TColorRef): Integer;

Overview

Refer to Examining and Altering Bitmaps.

Remarks

Fills the bitmap with the specified color.

The standard Windows values for COLORREF represent either red, green, and blue color values, or an index into the bitmap's palette. A COLORREF value with the format $00BBGGRR represents the blue, green, and red color values for the specified pixel, where $BB is the blue value, $GG is the green value and $RR is the red value. If $01000000 is set in the COLORREF value ($010000ZZ), the lower 8 bits ($ZZ) represent an index into the bitmap's palette which holds the color value.You can specify a COLORREF value (the return value of the RGB function), or you can specify a palette index as explained in Using Palette Indexes As Color Values.

In the Document/Medical toolkits, the COLORREF value may represent a 16 bit grayscale value if the bitmap is a 12 or 16-bit grayscale. So that the value is not confused with an RGB value, the COLORREF_GRAY16 mask ($04000000) is set. In this case ($0400YYYY), the lower 16 bits ($YYYY) of the COLORREF value represent the 16-bit grayscale value. ($0400FFFF is 16-bit white and $04000000is 16-bit black.) This is not a standard Windows value. Therefore, LEADTOOLS elements will recognize a COLORREF having this format, but Windows elements will not. For information on converting from a 16-bit value, refer to Converting 16-bit Grayscale Values.

This method does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this method.

See Also

Topics:

Raster Images: Creating and Deleting Images

 

Raster Images: Where the Region Preempts the Bitmap

 

Using Color Values in LEADTOOLS