L_FillBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_FillBitmap(pBitmap, crFill)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

COLORREF crFill;

/* fill color */

Fills the specified bitmap with the specified color.

Parameter

Description

pBitmap

Pointer to the bitmap handle referencing the target bitmap.

crFill

The fill 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 0x00BBGGRR represents the blue, green, and red color values for the specified pixel, where 0xBB is the blue value, 0xGG is the green value and 0xRR is the red value. If 0x01000000 is set in the COLORREF value (0x010000ZZ), the lower 8 bits (0xZZ) represent an index into the bitmap's palette which holds the color value. These COLORREF values can be used with any Windows function and macro that takes a COLORREF parameter

 

In the Document/Medical Imaging editions, the COLORREF value may represent a 16 bit grayscale value if pBitmap is a 12 or 16-bit grayscale bitmap. So that the value is not confused with an RGB value, the COLORREF_GRAY16 mask (0x04000000) is set. In this case (0x0400YYYY), the lower 16 bits (0xYYYY) of the COLORREF value represent the 16-bit grayscale value. (0x0400FFFF is 16-bit white and 0x04000000is 16-bit black.) This is not a standard Windows value. Therefore, LEADTOOLS functions will recognize a COLORREF having this format, but Windows functions will not. For information on how to use a 16-bit grayscale COLORREF in a non-LEADTOOLS function, refer to L_GetPixelColor.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

This function 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 function.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Functions:

L_ChangeBitmapIntensity, L_GammaCorrectBitmap, L_ChangeBitmapContrast, L_HistoContrastBitmap, L_StretchBitmapIntensity, L_RemapBitmapIntensity, L_InvertBitmap, L_ChangeBitmapHue, L_ChangeBitmapSaturation, L_HistoEqualizeBitmap, L_GetPixelColor, L_PutPixelColor, L_GetBitmapHistogram, L_ChannelMix, L_DeinterlaceBitmap, L_DesaturateBitmap, L_EdgeDetectStatisticalBitmap, L_LightControlBitmap, L_SmoothEdgesBitmap, L_LocalHistoEqualizeBitmap, L_AddWeightedBitmaps, L_ColorMergeBitmap, L_ColorSeparateBitmap, L_ConvertColorSpace, L_MultiplyBitmap, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_MathFunctionBitmap, L_SegmentBitmap, L_AdaptiveContrastBitmap, L_ApplyMathLogicBitmap, L_ColorIntensityBalance, L_ColorizeGrayBitmap, L_ContBrightIntBitmap, L_DigitalSubtractBitmap, L_DynamicBinaryBitmap, L_EdgeDetectEffectBitmap, L_FunctionalLightBitmap, L_MultiScaleEnhancementBitmap, L_SelectBitmapData, L_ShiftBitmapData

Topics:

Raster Image Functions: Modifying Intensity Values

 

Using Color Values in LEADTOOLS

Example

For complete sample code, refer to the FEATURE3 example.

/* This example loads a bitmap and fills it with blue. */
BITMAPHANDLE LeadBitmap;   /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
L_LoadBitmap
 (TEXT("IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Fill the bitmap with blue */
L_FillBitmap
(&LeadBitmap,RGB(0, 0, 255));