#include "Ltwrappr.h"
L_INT LRasterPaint::GetProperty(nGroup, pProperty)
Gets the specified paint properties.
Indicates the paint properties to get and the structure pointed to by pProperty. Possible values are:
Value | Meaning |
---|---|
PAINT_GROUP_BRUSH | Gets the Paintbrush properties. pProperty points to a PAINTBRUSH structure. |
PAINT_GROUP_SHAPE | Gets the Paint shape properties. pProperty points to a PAINTSHAPE structure. |
PAINT_GROUP_REGION | Gets the Paint region properties. pProperty points to a PAINTREGION structure. |
PAINT_GROUP_FILL | Gets the Paint fill properties. pProperty points to a PAINTFILL structure. |
PAINT_GROUP_TEXT | Gets the Paint fill properties. pProperty points to a PAINTTEXT structure. |
Pointer to a PAINTXXX structure to be updated with the specified property values. The type of structure that this parameter points to is indicated by the nGroup parameter.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes |
If this function is called after the class object handle is initialized, the default values will be returned. For more information about the default property values, refer to:
Required DLLs and Libraries
This example shows the minimum requirements for painting a rectangle shape using some user defined properties.
L_INT LRasterPaint_GetPropertyExample(CWnd* pWnd)
{
L_INT nRet;
LRasterPaint rstp;
PAINTSHAPE shape ;
CDC* pDC = pWnd->GetDC() ;
RECT rcShapeRect ;
RECT rcDCExtents ;
/* Initiate the Paint toolkit */
nRet = rstp.Initialize ( );
if(nRet != SUCCESS)
return nRet;
/*Set the paint shape group properties */
nRet = rstp.GetProperty ( PAINT_GROUP_SHAPE, &shape ) ;
if(nRet != SUCCESS)
return nRet;
/* Do some check and chang to the required properties*/
if ( PAINT_SHAPE_BORDER_STYLE_SOLID == shape.nBorderStyle )
{
/* Set the desired shape properties using the field masks*/
shape.nSize = sizeof ( PAINTSHAPE ) ;
shape.dwMask = PSF_BORDERSTYLE |
PSF_BORDERWIDTH |
PSF_BORDERENDCAP ;
shape.nBorderStyle = PAINT_SHAPE_BORDER_STYLE_DOT ;
shape.nBorderWidth = 10 ;
shape.nBorderEndCap = PAINT_SHAPE_BORDER_ENDCAP_ROUND ;
/*Set the paint shape group properties */
nRet = rstp.SetProperty ( PAINT_GROUP_SHAPE, &shape ) ;
if(nRet != SUCCESS)
return nRet;
}
/* Set the rectangle coordinates with respect to the DC dimensions*/
SetRect ( &rcShapeRect, 10, 10, 110, 110 ) ;
/* Get the destination DC dimensions */
pWnd->GetClientRect ( &rcDCExtents ) ;
/* Set the toolkit user DC extents */
nRet = rstp.SetDCExtents ( &rcDCExtents ) ;
if(nRet != SUCCESS)
return nRet;
/* Use the current shape properties to draw an rectangle*/
nRet = rstp.DrawShapeRectangle ( pDC->m_hDC, &rcShapeRect ) ;
if(nRet != SUCCESS)
return nRet;
// Free the paint tools handle.
nRet = rstp.Free ( ) ;
if(nRet != SUCCESS)
return nRet;
pWnd->ReleaseDC( pDC ) ;
return SUCCESS ;
}