LBitmapRgn::ResizeRgn

#include "ltwrappr.h"

virtual L_INT LBitmapRgn::ResizeRgn(uInflate, uFlag, bAsFrame)

L_UINT uInflate;

/* number of pixels by which to resize the region */

L_UINT uFlag;

/* flag */

L_BOOL bAsFrame;

/* flag */

Resizes the region defined in the class object's bitmap by the specified number of pixels.

Parameter

Description

uInflate

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

LTDIS
LTFIL
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.

See Also

Functions:

LBitmapBase::Resize, LBuffer::Resize, Class Members

Topics:

Raster Image Functions: Creating and Using a Region

 

Working with the Existing Bitmap Region

Example

L_VOID TestFunction(LBitmap & Bitmap, L_TCHAR * szFile)
{
   LBitmapRgn Region;
   RECT rect = { Bitmap.GetWidth() / 4, Bitmap.GetHeight() / 4,
                 Bitmap.GetWidth() / 2, Bitmap.GetHeight() / 2 };
   
   Bitmap.Load(szFile);
   Region.SetBitmap(&Bitmap);
   Region.SetRgnRect(&rect);

   Bitmap.Invert();

   Region.ResizeRgn(20, RGN_CONTRACT, FALSE);

   Bitmap.Invert();
}