Products | Support | Send comments on this topic. | Email a link to this topic. | Back to Getting Started | Help Version 18.0.10.24
LEADTOOLS Raster imaging C++ Class library help

Floaters and Regions in the LBitmapWindow Class

Show in webframe

The LBitmapWindow class automates the region and floater capabilities of the toolkit.

Some definitions:

Floater

A selection (actually, a separate bitmap) that has an animated outline.

Region

A subset of a bitmap, much like a Windows region. When a bitmap has a region, most image processing functions will only process the region and not the entire bitmap.

 

The following are various scenarios and how they can be implemented with the LBitmapWindow class.

Scenario One

I want to create a floater with the region tool, and move it around. I don't want a region

m_BitmapWindow.SetAutoFloaterToRgn(FALSE)
m_BitmapWindow.SetToolType(TOOL_REGION)
m_BitmapWindow.SetRegionType(REGION_TYPE_RECT)
<Click and drag mouse to create floater>
<Drag mouse to move floater>

In this scenario, no region is created

 

Scenario Two

I want to create a region with the region tool. I don't want the floater.

m_BitmapWindow.SetAutoFloaterToRgn(TRUE)
m_BitmapWindow.SetToolType(TOOL_REGION)
m_BitmapWindow.SetRegionType(REGION_TYPE_RECT)
Click and drag mouse to create floater
m_BitmapWindow.CancelRgn() //this removes the floater, but leaves the bitmap region

In this scenario, a region is created and the floater is destroyed.

 

Scenario Three

I want to create a floater programmatically (without using the tools). I don't want a bitmap region.

RECT Rect={10,20,50,100};
m_ BitmapWindow.SetAutoRgnToFloater(TRUE);
LBitmapRgn Region(&m_ BitmapWindow);
Region.SetRgnRect(&Rect);

 

Scenario Four

I want to create a region programmatically (without using the tools). I don't want a floater.

RECT Rect={10,20,50,100};
m_ BitmapWindow.SetAutoRgnToFloater(FALSE);
LBitmapRgn Region(&m_ BitmapWindow);
Region.SetRgnRect(&Rect);

Related Topics:

Saving a Region

Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.