LRasterPaint::SetProperty

#include "Ltwrappr.h"

L_INT LRasterPaint::SetProperty(nGroup, pProperty)

PAINTGROUP nGroup;

type of paint properties

L_VOID * pProperty;

pointer to a PAINTXXX structure

Sets 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 Sets the Paintbrush properties. pProperty points to a PAINTBRUSH structure.
  PAINT_GROUP_SHAPE Sets the Paint shape properties. pProperty points to a PAINTSHAPE structure.
  PAINT_GROUP_REGION Sets the Paint region properties. pProperty points to a PAINTREGION structure.
  PAINT_GROUP_FILL Sets the Paint fill properties. pProperty points to a PAINTFILL structure.
  PAINT_GROUP_TEXT Sets the Paint fill properties. pProperty points to a PAINTTEXT structure.
pProperty Pointer to a PAINTXXX structure that contains the property values to set. The type of structure that this parameter points to is indicated by the nGroup parameter. The user should set the nSize and dwMask of any of the PAINTXXX structures with proper values before calling this function.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes

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::GetProperty, 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

L_INT LRasterPaint_SetPropertyExample(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 desired shape properties using the field masks*/ 
   shape.nSize                = sizeof ( PAINTSHAPE ) ; 
   shape.dwMask               = PSF_BACKGROUNDSTYLE | 
   PSF_BORDERSTYLE | 
   PSF_BORDERCOLOR | 
   PSF_BORDERWIDTH | 
   PSF_BORDERENDCAP | 
   PSF_GRADIENTSTYLE | 
   PSF_GRADIENTSTARTCOLOR | 
   PSF_GRADIENTENDCOLOR   | 
   PSF_GRADIENTSTEPS ; 
   shape.nBackgroundStyle     = PAINT_SHAPE_BACK_STYLE_GRADIENT; 
   shape.nBorderStyle         = PAINT_SHAPE_BORDER_STYLE_DOT ; 
   shape.crBorderColor        = RGB ( 255, 0, 0 ) ; 
   shape.nBorderWidth         = 10 ; 
   shape.nBorderEndCap        = PAINT_SHAPE_BORDER_ENDCAP_ROUND ; 
   shape.nGradientStyle       = PAINT_SHAPE_GRADIENT_STYLE_CONE_FROM_L ; 
   shape.crGradientStartColor = RGB ( 255, 192, 0 ) ; 
   shape.crGradientEndColor   = RGB ( 0, 0, 255 ) ; 
   shape.uGradientSteps       = 255 ; 
   /*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 a rectangle*/ 
   nRet = rstp.DrawShapeRectangle ( pDC->m_hDC, &rcShapeRect ) ; 
   if(nRet != SUCCESS) 
      return nRet; 
   /* Release the device context*/ 
   pWnd->ReleaseDC( pDC ) ; 
   // Free the paint tools handle. 
   nRet = rstp.Free ( ) ; 
   if(nRet != SUCCESS) 
      return nRet; 
   return SUCCESS ; 
} 

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS DigitalPaint C++ Class Library Help