LRasterPaint::GetProperty

#include "Ltwrappr.h"

L_INT LRasterPaint::GetProperty(nGroup, pProperty)

PAINTGROUP nGroup;

/* pointer to a paint handle */

L_VOID *pProperty;

/* pointer to a PAINTXXX structure */

Gets the specified paint properties.

Parameter

Description

nGroup

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.

pProperty

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.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes

Comments

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:

PAINTBRUSH

PAINTSHAPE

PAINTREGION

PAINTFILL

PAINTTEXT

Required DLLs and Libraries

LTPNT

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:

LRasterPaint::SetProperty, LRasterDialog::DoModalBrush, LRasterDialog::DoModalFill, LRasterDialog::DoModalRegion, LRasterDialog::DoModalShape, LRasterDialog::DoModalText, LRasterPaint::BrushLineTo, LRasterPaint::BrushMoveTo, LRasterPaint::ApplyText, LRasterPaint::DrawShapeEllipse, LRasterPaint::DrawShapeLine, LRasterPaint::DrawShapePolyBezier, LRasterPaint::DrawShapePolygon, LRasterPaint::DrawShapeRectangle, LRasterPaint::DrawShapeRoundRect, LRasterPaint::RegionBorder, LRasterPaint::RegionColor, LRasterPaint::RegionEllipse, LRasterPaint::RegionPolygon, LRasterPaint::RegionRect, LRasterPaint::RegionRoundRect, Class Members

Topics:

Setting DigitalPaint Properties

Example

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 ;
   /* 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 ) ;
   /* 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 ;
}