从项目中创建低级DigitalPaint:处理窗口激活消息。
IDM_DIALOGTEST_SHAPE# include“C: \ LEADTOOLS21 \ \ Ltpdg.h包括”
L_VOID OnShapeDlg (HWND HWND, pPAINTHANDLE pPaint){PAINTSHAPE形状;PAINTDLGSHAPEINFO ShapeDlgInfo;L_INT nRet;矩形rcRect;HDC hdcTest;hdcTest = GetDC (hWnd);L_PntGetProperty (pPaint PAINT_GROUP_SHAPE如出一辙);ShapeDlgInfo。dwFlags = PAINT_DLG_SHAPE_SHOWALL;ShapeDlgInfo。pszTitle =文本(“形状属性”);ShapeDlgInfo。nBackgroundStyle =形状。nBackgroundStyle;ShapeDlgInfo。crBackgroundColor =形状。crBackgroundColor;ShapeDlgInfo。ppszBackgroundTileBitmap =零;ShapeDlgInfo。uBackgroundTileBitmapCount = 0;ShapeDlgInfo。nActiveBackgroundTileBitmapItem = 1;ShapeDlgInfo。nBorderStyle =形状。nBorderStyle;ShapeDlgInfo。nBorderBrushStyle =形状。nBorderBrushStyle;ShapeDlgInfo。crBorderColor =形状。crBorderColor;ShapeDlgInfo。ppszBorderTileBitmap =零;ShapeDlgInfo。uBorderTileBitmapCount = 0;ShapeDlgInfo。nActiveBorderTileBitmapItem = 1;ShapeDlgInfo。nBorderWidth =形状。nBorderWidth;ShapeDlgInfo。nBorderEndCap =形状。nBorderEndCap;ShapeDlgInfo。nGradientStyle =形状。nGradientStyle;ShapeDlgInfo。crGradientStartColor =形状。crGradientStartColor;ShapeDlgInfo。crGradientEndColor =形状。crGradientEndColor;ShapeDlgInfo。uGradientSteps =形状。uGradientSteps;ShapeDlgInfo。nRoundRectEllipseWidth =形状。nRoundRectEllipseWidth;ShapeDlgInfo。nRoundRectEllipseHeight =形状。nRoundRectEllipseHeight;ShapeDlgInfo。nOpacity =形状。nOpacity;ShapeDlgInfo。ppszPaperTexture =零;ShapeDlgInfo。uPaperTextureCount = 0;ShapeDlgInfo。nActivePaperTextureItem = 1;nRet = L_PntDlgShape (hWnd, &ShapeDlgInfo);如果(成功= = nRet){形状。nSize =运算符(PAINTSHAPE);形状。dwMask = PSF_ALL;形状。nBackgroundStyle = ShapeDlgInfo。nBackgroundStyle;形状。crBackgroundColor = ShapeDlgInfo。crBackgroundColor;形状。pBackgroundTileBitmap =零;形状。nBorderStyle = ShapeDlgInfo。nBorderStyle;形状。nBorderBrushStyle = ShapeDlgInfo。nBorderBrushStyle;形状。crBorderColor = ShapeDlgInfo。crBorderColor;形状。hBorderTileBitmap =零;形状。nBorderWidth = ShapeDlgInfo。nBorderWidth;形状。nBorderEndCap = ShapeDlgInfo。nBorderEndCap;形状。nGradientStyle = ShapeDlgInfo。nGradientStyle;形状。crGradientStartColor = ShapeDlgInfo。crGradientStartColor;形状。crGradientEndColor = ShapeDlgInfo。crGradientEndColor;形状。uGradientSteps = ShapeDlgInfo。uGradientSteps;形状。nRoundRectEllipseWidth = ShapeDlgInfo。nRoundRectEllipseWidth;形状。nRoundRectEllipseHeight = ShapeDlgInfo。nRoundRectEllipseHeight;形状。nOpacity = ShapeDlgInfo。nOpacity;形状。pTexture =零;L_PntSetProperty (pPaint PAINT_GROUP_SHAPE如出一辙);/ /现在画一些看到的结果对话框设置SetRect (&rcRect、10、10、100、100);L_PntDrawShapeRectangle (pPaint hdcTest &rcRect);}}
情况下IDM_DIALOGTEST_SHAPE:OnShapeDlg (hWnd, pPaint);返回0 l;
添加以下行Imports.cpp
#如果定义(FOR_WIN64) < / p ># pragma评论(自由,“. . \ \ . \ \ . . \ \ . \ \ . \ \ . . \ \ Lib \ \ CDLLVC10 \ \ x64 \ \ ltpdg_x.lib”)# elif定义(FOR_WIN32) < / p ># pragma评论(自由,“. . \ \ . \ \ . . \ \ . \ \ . \ \ . . \ \ Lib \ \ CDLLVC10 \ \ Win32 \ \ ltpdg_u.lib”)# endif
通过选择编译和运行这个项目构建- >执行教程。从菜单中exe。