L_CanvasBitmap

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_CanvasBitmap(pBitmap, pThumbBitmap, uTransparency, uEmboss, nXOffset, nYOffset, uTilesOffset, uFlags)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

pBITMAPHANDLE pThumbBitmap;

/* pointer to the bitmap handle */

L_UINT uTransparency;

/* the transparency amount */

L_UINT uEmboss;

/* image intensity */

L_INT nXOffset;

/* the x distance */

L_INT nYOffset;

/* the y distance */

COLORREF uTilesOffset;

/* the amount of shifting */

L_UINT uFlags;

/* flags */

Combines two bitmaps, superimposing one bitmap on another bitmap that is used like a canvas. This function is available in the Raster Pro and above toolkits.

Parameter

Description

pBitmap

Pointer to the bitmap handle that references the bitmap that will be applied to the canvas bitmap.

pThumbBitmap

Pointer to the bitmap handle that references the canvas bitmap.

uTransparency

The transparency amount between the image and the canvas. Valid range is from 0 to 100. When set to 0, only the canvas image displays, and when set to 100, the canvas image is barely visible.

uEmboss

Apparent depth of the canvas image. Valid range is from 0 to 200. When uTransparency is at 100, and uEmboss is 0 only the image displays. Increasing uEmboss increases the apparent depth of the canvas image.

nXOffset

The X distance between the canvas origin point and the image origin point (in pixels). Valid range is from –Canvas bitmap width to +Canvas bitmap width.

nYOffset

The Y distance between the canvas origin point and the image origin point (in pixels). Valid range is from –Canvas bitmap height to +Canvas bitmap height.

uTilesOffset

The amount to shift every row of canvas image from the origin. This parameter is not used when uFlags is set to CANVAS_FIT.

uFlags

Flags that identifiy how to distribute the canvas image with respect to the image and how to handle resizing.

The following flags identify how the distribute the canvas image with respect to the image:

 

Value

Meaning

 

CANVAS_FIT

[0x0000] Fit the canvas image so it has the same dimensions as the bitmap that is being applied to the canvas, without tiling.

 

CANVAS_SHIFT

[0x0010] Shift the canvas image by the amount specified in uTilesOffset.

 

The following flags identify which resizing method to use to resize the canvas image in order to fit the original image:

 

Value

Meaning

 

SIZE_NORMAL

[0x0000] Resize normally.

 

SIZE_RESAMPLE

[0x0002] Use linear interpolation and averaging to produce a higher quality image.

 

SIZE_BICUBIC

[0x0004] Use bicubic interpolation and averaging to produce a higher quality image. This is slower than SIZE_RESAMPLE.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

The L_CanvasBitmap function combines two bitmaps, superimposing one bitmap on another bitmap that is used like a canvas.

As an example, if you use the following figure:

image\Rafting.gif

and you use the following figure as the canvas bitmap:

image\ULAY2.gif

And you call L_CanvasBitmap using the following values:

Parameter

Value

uTransparency

90

uEmboss

117

nXOffset

0

nYOffset

0

uFlags

CANVAS_SHIFT

uTilesOffset

0

The following figure results:

image\canvas.gif

In the following figure the rafting image has been combined with the canvas bitmap using the same values, except that the CANVAS_FIT flag is used and so instead of tiling the canvas bitmap has been stretched to fit the dimensions of the rafting image:

image\fit.gif

Other functions that allow you to combine images include:

L_BumpMapBitmap

L_CombineBitmap

L_CombineBitmapWarp

L_TextureAlphaBlendBitmap

L_UnderlayBitmap

For more information on this and other functions that can be used to combine bitmaps, refer to Processing an Image.

This function supports 12- and 16-bit grayscale and 48- and 64-bit color images. Support for 12- and 16-bit grayscale and 48- and 64-bit color images is available only in the Document/Medical toolkits.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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

LTIMG

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.

See Also

Functions:

L_EmbossBitmap, L_AddShadowBitmap, L_AllocFTArray, L_BumpMapBitmap, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_CombineBitmap, L_CombineBitmapWarp, L_DFTBitmap, L_DirectionEdgeStatisticalBitmap, L_FFTBitmap, L_FreeFTArray, L_FrqFilterBitmap, L_FrqFilterMaskBitmap, L_FTDisplayBitmap, L_GetBitmapStatisticsInfo, L_GetFeretsDiameter, L_GetObjectInfo, L_GetRgnContourPoints, L_GetRgnPerimeterLength, L_MathFunctionBitmap, L_SegmentBitmap, L_SubtractBackgroundBitmap, L_TextureAlphaBlendBitmap, L_UnderlayBitmap, L_UserFilterBitmap.

Topics:

Raster Image Functions: Combining Images

 

Raster Image Functions: Artistic Effects

 

Applying Artistic Effects

 

Processing an Image

 

Raster Image Functions: Processing an Image

Example

BITMAPHANDLE LeadBitmap;   /* Bitmap handle for the image */
BITMAPHANDLE CanvasBitmap; /*Bitmap handle for the canvas image */
/* Load a bitmap at its own bits per pixel */
L_LoadBitmap
 (TEXT ("IMAGE3.CMP"), &LeadBitmap, sizeof (BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Load a bitmap at its own bits per pixel */
L_LoadBitmap
 (TEXT ("ULAY1.bmp"), &CanvasBitmap, sizeof (BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
/* Apply the Canvas bitmap effect to the image*/
L_CanvasBitmap
(&LeadBitmap, &CanvasBitmap, 100, 100, 0, 0, 10, CANVAS_SHIFT);