Working with the Existing Bitmap Region

You can save a region in the alpha channel of a 16- or 32-bit file. For an example, refer to LBitmapBase::SetAlpha.

You can use the LBitmapBase::HasRgn function to see if a bitmap has a region. If the bitmap has a region, you can do the following with it:

image\sqrblit.gif Use LPaint::FrameRgn to outline the region.

image\sqrblit.gif Display the region using functions described in Displaying a Region.

image\sqrblit.gif Use LBitmapRgn::GetRgnHandle to create a Windows region that is a snapshot of the bitmap region.

image\sqrblit.gif Use LBitmapRgn::Offset to move the region.

image\sqrblit.gif Use LBitmapRgn::GetRgnArea, LBitmapRgn::GetRgnBounds, and LBitmapRgn::IsPtInRgn to get information about the region's size and location.

image\sqrblit.gif Use LPaint::ColorRgn to display a filled, color representation of a region.

image\sqrblit.gif Determine the number of maximum number of segments present in any row in the region by calling LBitmapRgn::GetClipSegmentsMax. Once this is known, a buffer can be allocated and the segments can be retrieved using the LBitmapRgn::GetClipSegments function.

image\sqrblit.gif To create a new region, or update an existing region, based on either an HSV range or an RGB range, use the LBitmapRgn::SetRgnColorHSVRange function or the LBitmapRgn::SetRgnColorRGBRange function.

image\sqrblit.gif To create a new curve region, or update an existing region with a curve region, use LBitmapRgn::SetRgnCurve.

image\sqrblit.gif To resize a bitmap region a specific number of pixels, use the LBitmapRgn::ResizeRgn function.

image\sqrblit.gif Use LBitmapRgn::Free to free the region.

image\sqrblit.gif Use LBitmapRgn::Free to free the region.

To create a new curve region, or update an existing region with a curve region, use LBitmapRgn::SetRgnCurve.

To resize a bitmap region a specific number of pixels, use the LBitmapRgn::ResizeRgn function.

Use LBitmapRgn::HolesRemovalRgn to remove holes from a bitmap region.

Related Topics:

image\sqrblit.gif Saving a Region