L_ResizeBitmapRgn

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_ResizeBitmapRgn(pBitmap, uDim, uFlag, bAsFrame)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

L_UINT uDim;

/* number of pixels to resize the width */

L_UINT uFlag;

/* flag */

L_BOOL bAsFrame;

/* flag */

Resizes a bitmap region by the specified number of pixels.

Parameter

Description

pBitmap

Pointer to the bitmap handle that references the bitmap to resize.

uDim

Number of pixels by which to resize the region.

uFlag

Flag that indicates whether to contract or expand the bitmap region. Possible values are:

 

Value

Meaning

 

RGN_EXPAND

[0x0001] Expand the region.

 

RGN_CONTRACT

[0x0002] Contract the region.

bAsFrame

Flag that indicates whether to create a frame associated with the resized bitmap region. Possible values are:

 

Value

Meaning

 

TRUE

Create a frame of thickness uDim for the resized region. If uFlag is RGN_EXPAND, the frame created will exist outside the boundaries of the resized region. If uFlag is RGN_CONTRACT, the frame will be within the boundaries of the resized region.

 

FALSE

Resize the region only. Do not create a frame.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

This function keeps the same bitmap handle and resizes the bitmap region that it references.

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.

This function supports signed data images.

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_ResampleBitmap, L_ResizeBitmap, L_StartResize, L_Resize, L_StopResize, L_DlgResize

Topics:

Raster Image Functions: Creating and Using a Region

 

Working with the Existing Bitmap Region

Example

/*For complete sample code, refer to the ImgChd.c module of the IMGFEATR example. */

/* This example changes a bitmap region size */
BITMAPHANDLE LeadBitmap;       /* Bitmap handle to hold the loaded image. */

void TestFunction( )
{
   RECT rRgnRect;               /* Rectangle that defines the region /
 /* Load a bitmap */
   L_LoadBitmap (TEXT("RESIZERGN.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE),0,ORDER_BGR,NULL, NULL);
/* Specify a rectangle to define a region , this region specify by the mouse on IMGFEATR demo*/
SetRect(&rRgnRect, 80, 20, 100, 40);
/* Create an elliptical region */
L_SetBitmapRgnEllipse
 (&LeadBitmap, NULL, &rRgnRect, L_RGN_SET);
   /* contract the bitmap region by 20 pixels*/
   L_ResizeBitmapRgn(&LeadBitmap, 20, RGN_CONTRACT, FALSE);
   /* Free the region */
   L_FreeBitmapRgn(&LeadBitmap);
}