Start with the project you created in Low-Level DigitalPaint: Processing the Window Activation Messages.
IDM_DIALOGTEST_SHAPE
#include "C:\LEADTOOLS22\Include\Ltpdg.h"
L_VOID OnShapeDlg ( HWND hWnd, pPAINTHANDLE pPaint )
{
PAINTSHAPE shape ;
PAINTDLGSHAPEINFO ShapeDlgInfo ;
L_INT nRet ;
RECT rcRect;
HDC hdcTest;
hdcTest = GetDC (hWnd);
L_PntGetProperty ( pPaint, PAINT_GROUP_SHAPE, &shape ) ;
ShapeDlgInfo.dwFlags = PAINT_DLG_SHAPE_SHOWALL ;
ShapeDlgInfo.pszTitle = TEXT("Shape Properties");
ShapeDlgInfo.nBackgroundStyle = shape.nBackgroundStyle ;
ShapeDlgInfo.crBackgroundColor = shape.crBackgroundColor ;
ShapeDlgInfo.ppszBackgroundTileBitmap = NULL ;
ShapeDlgInfo.uBackgroundTileBitmapCount = 0 ;
ShapeDlgInfo.nActiveBackgroundTileBitmapItem = -1 ;
ShapeDlgInfo.nBorderStyle = shape.nBorderStyle ;
ShapeDlgInfo.nBorderBrushStyle = shape.nBorderBrushStyle ;
ShapeDlgInfo.crBorderColor = shape.crBorderColor ;
ShapeDlgInfo.ppszBorderTileBitmap = NULL ;
ShapeDlgInfo.uBorderTileBitmapCount = 0 ;
ShapeDlgInfo.nActiveBorderTileBitmapItem = -1 ;
ShapeDlgInfo.nBorderWidth = shape.nBorderWidth ;
ShapeDlgInfo.nBorderEndCap = shape.nBorderEndCap ;
ShapeDlgInfo.nGradientStyle = shape.nGradientStyle ;
ShapeDlgInfo.crGradientStartColor = shape.crGradientStartColor ;
ShapeDlgInfo.crGradientEndColor = shape.crGradientEndColor ;
ShapeDlgInfo.uGradientSteps = shape.uGradientSteps ;
ShapeDlgInfo.nRoundRectEllipseWidth = shape.nRoundRectEllipseWidth ;
ShapeDlgInfo.nRoundRectEllipseHeight = shape.nRoundRectEllipseHeight ;
ShapeDlgInfo.nOpacity = shape.nOpacity ;
ShapeDlgInfo.ppszPaperTexture = NULL ;
ShapeDlgInfo.uPaperTextureCount = 0 ;
ShapeDlgInfo.nActivePaperTextureItem = -1 ;
nRet = L_PntDlgShape ( hWnd, &ShapeDlgInfo ) ;
if ( SUCCESS == nRet )
{
shape.nSize = sizeof ( PAINTSHAPE ) ;
shape.dwMask = PSF_ALL ;
shape.nBackgroundStyle = ShapeDlgInfo.nBackgroundStyle ;
shape.crBackgroundColor = ShapeDlgInfo.crBackgroundColor ;
shape.pBackgroundTileBitmap = NULL ;
shape.nBorderStyle = ShapeDlgInfo.nBorderStyle ;
shape.nBorderBrushStyle = ShapeDlgInfo.nBorderBrushStyle ;
shape.crBorderColor = ShapeDlgInfo.crBorderColor ;
shape.hBorderTileBitmap = NULL ;
shape.nBorderWidth = ShapeDlgInfo.nBorderWidth ;
shape.nBorderEndCap = ShapeDlgInfo.nBorderEndCap ;
shape.nGradientStyle = ShapeDlgInfo.nGradientStyle ;
shape.crGradientStartColor = ShapeDlgInfo.crGradientStartColor ;
shape.crGradientEndColor = ShapeDlgInfo.crGradientEndColor ;
shape.uGradientSteps = ShapeDlgInfo.uGradientSteps ;
shape.nRoundRectEllipseWidth = ShapeDlgInfo.nRoundRectEllipseWidth ;
shape.nRoundRectEllipseHeight = ShapeDlgInfo.nRoundRectEllipseHeight ;
shape.nOpacity = ShapeDlgInfo.nOpacity ;
shape.pTexture = NULL ;
L_PntSetProperty ( pPaint, PAINT_GROUP_SHAPE, &shape ) ;
// now draw something to see the results of the dialog settings
SetRect(&rcRect, 10, 10, 100, 100);
L_PntDrawShapeRectangle(pPaint, hdcTest, &rcRect);
}
}
case IDM_DIALOGTEST_SHAPE:
OnShapeDlg ( hWnd, pPaint ) ;
return 0L ;
Add the following lines in Imports.cpp
#if defined(FOR_WIN64)</p>
#pragma comment(lib, "..\\..\\..\\..\\..\\..\\Lib\\CDLL\\x64\\ltpdg_x.lib")
#elif defined(FOR_WIN32)</p>
#pragma comment(lib, "..\\..\\..\\..\\..\\..\\Lib\\CDLL\\Win32\\ltpdg_u.lib")
#endif
Compile and run the project by selecting Build->Execute tutorial.exe from the menu.