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:

LRasterDialog::DoModalBrush

LRasterDialog::DoModalFill

LRasterDialog::DoModalShape

LRasterDialog::DoModalRegion

LRasterDialog::DoModalText

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

 

// This example will display the brush common dialog 

L_VOID BrushDlgTest ( HWND hWnd, L_BOOL bUseDef )
{
   LRasterDialog     lRstDlg ;
   L_TCHAR            * ppszTouchImage [ ] = { TEXT("Image 0"), TEXT("Image 1"), TEXT("Image 2"), TEXT("Image 3"), TEXT("Image 4") } ;
   PAINTDLGBRUSHINFO DlgBrushInfo ; 

   if ( bUseDef == TRUE ) 
   {  
      DlgBrushInfo.dwFlags = PAINT_DLG_BRUSH_INITUSEDEFAULT |  PAINT_DLG_BRUSH_SHOWALL ; 
   }
   else
   {
       DlgBrushInfo.nSize          = sizeof ( PAINTDLGBRUSHINFO ) ;
       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_SHOWTRANSPARENTCOLOR |
                                                       PAINT_DLG_BRUSH_SHOWDEFAULT ;

       DlgBrushInfo.pszTitle              = TEXT("Lead Brush Common Dialog ") ;
       DlgBrushInfo.nContentsType  = PAINT_TOUCH_CONTENTS_COLOR; 
       DlgBrushInfo.crColor               = RGB ( 255, 0, 0 ) ; 
       DlgBrushInfo.ppszTouchImage = ppszTouchImage ;
       DlgBrushInfo.uTouchImageCount  = 5 ;
       DlgBrushInfo.nActiveTouchImageItem = 1 ;
       DlgBrushInfo.crTransparentColor = RGB(0,0,0);
       DlgBrushInfo.nDiameter                = 15 ;    
       DlgBrushInfo.nHardnessValue      = 75 ;
       DlgBrushInfo.nSpacing                 = 10 ;
       DlgBrushInfo.nOpacity                  = 10 ;  

   }
   lRstDlg.DoModalBrush ( hWnd, &DlgBrushInfo ) ;

   return ;

}