Using the DigitalPaint Common Dialogs

LEADTOOLS DigitalPaint provides a number of functions for displaying dialogs. The DigitalPaint Common Dialogs provide an easier way to enter or change painting settings. The functions for displaying the dialogs are:

L_PntDlgBrush

L_PntDlgFill

L_PntDlgShape

L_PntDlgRegion

L_PntDlgText

The following example shows the use of the DigitalPaint Common Dialog.

// This example will display the brush common dialog 
L_TCHAR * g_ppszTouchImage [ ] = { TEXT("Image 0"), TEXT("Image 1"), TEXT("Image 2"), TEXT("Image 3"), TEXT("Image 4") } ; 
PAINTDLGBRUSHINFO g_DlgBrushInfo ; 
L_VOID BrushDlgTest ( HWND hWnd, L_BOOL fUseDef ) 
{ 
   if ( fUseDef == TRUE ) 
   { 
      g_DlgBrushInfo.dwFlags = PAINT_DLG_BRUSH_INITUSEDEFAULT | 
      PAINT_DLG_BRUSH_SHOWALL ; 
   } 
   else 
   { 
      g_DlgBrushInfo.nSize          = sizeof ( PAINTDLGBRUSHINFO ) ; 
      g_DlgBrushInfo.dwFlags      = PAINT_DLG_BRUSH_SHOWTOUCHCONTENT | 
      PAINT_DLG_BRUSH_SHOWTOUCHCOLOR | 
      PAINT_DLG_BRUSH_SHOWTOUCHIMAGE | 
      PAINT_DLG_BRUSH_SHOWDIAMETER   | 
      PAINT_DLG_BRUSH_SHOWHARDNESS   | 
      PAINT_DLG_BRUSH_SHOWSPACING    | 
      PAINT_DLG_BRUSH_SHOWOPACITY    | 
      PAINT_DLG_BRUSH_SHOWRESET ; 
      PAINT_DLG_BRUSH_SHOWDEFAULT; 
      g_DlgBrushInfo.pszTitle              = TEXT("Lead Brush Common Dialog "); 
      g_DlgBrushInfo.nContentsType  = PAINT_TOUCH_CONTENTS_COLOR; 
      g_DlgBrushInfo.crColor               = RGB ( 255, 0, 0 ) ; 
      g_DlgBrushInfo.ppszTouchImage = g_ppszTouchImage ; 
      g_DlgBrushInfo.uTouchImageCount  = 5 ; 
      g_DlgBrushInfo.nActiveTouchImageItem = 1 ; 
      g_DlgBrushInfo.crTransparentColor = RGB(0, 0, 0) ; 
      g_DlgBrushInfo.nDiameter                = 15 ; 
      g_DlgBrushInfo.nHardnessValue      = 75 ; 
      g_DlgBrushInfo.nSpacing                 = 10 ; 
      g_DlgBrushInfo.nOpacity                  = 10 ; 
   } 
   L_PntDlgBrush ( hWnd, &g_DlgBrushInfo ) ; 
   return ; 
} 

As seen in the example, the dialog gives the programmer the flexibility to show or hide every dialog control. This gives the programmer the freedom to show only the desired features.

Help Version 22.0.2022.12.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Digital Paint C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.