YOU CAN CODE!

 

With The Case Of UCanCode.net  Release The Power OF  Visual C++ !   HomeProducts | PurchaseSupport | Downloads  
XD++ Library
DocVizor
TFC Library
Free Products
Technical Support
UCanCode.net


Get Ready to Unleash the Power of UCanCode .NET


UCanCode Software focuses on general application software development. We provide complete solution for developers. No matter you want to develop a simple database workflow application, or an large flow/diagram based system, our product will provide a complete solution for you. Our product had been used by hundreds of top companies around the world!

"100% source code provided! Free you from not daring to use components because of unable to master the key technology of components!"


VC++ MFC Tutorial: GDI,CRgn,CreateRectRgn,CreateEllipticRgn,CreatePolygonRgn,CombineRgn,RectInRegion,Free Source Code Download

 
 

Regions

Support for GDI regions is provided in MFC through the CRgn class. A region is created by first creating the CRgn object, and then calling an initialization function.

There are a large number of CRgn initialization functions. These are summarized in Table 2.

    Table 2. CRgn initialization functions.

Member Function


Creates


CreateRectRgn

A rectangular region

CreateRectRgnIndirect

A region from a RECT structure

CreateEllipticRgn

An elliptical region

CreateEllipticRgnIndirect

An elliptical region from a RECT structure

CreatePolygonRgn

A polygonal region

CreatePolyPolygonRgn

A region of several (possibly disjoint) polygons

CreateRoundRectRgn

A region in the shape of a rounded rectangle

CombineRgn

A region that is the union of two existing regions

CopyRgn

A region that is the copy of another region

CreateFromPath

A region from a path

CreateFromData

A region from a RGNDATA structure and an XFORM matrix

To compare two CRgn objects and check if they are equivalent, use the EqualRgn member function. To obtain a RGNDATA structure for a CRgn object, call GetRegionData. To obtain a region's bounding rectangle (that is, the tightest rectangle that encloses the region), call GetRgnBox.

To set a region to a specific rectangle, call SetRectRgn. To move a region by a specific offset, use OffsetRgn.

You can determine whether a given point or parts of a given rectangle fall within the region; use the PtInRegion or RectInRegion member functions.

A CRgn object can be used in place of an HRGN handle in GDI function calls, thanks to the presence of the operator function operator HRGN.

MFC Example

 

 

Copyright ?1998-2007 UCanCode.Net Software , all rights reserved.
Other product and company names herein may be the trademarks of their respective owners.

Please direct your questions or comments to webmaster@ucancode.net