#include "Ltwrappr.h"
L_INT LRasterDialog::DoModalBrush(hWnd, pBrushDlgInfo)
Brings up the paintbrush properties dialog box.
Handle of the window that owns the dialog.
Pointer to a PAINTDLGBRUSHINFO structure that contains paintbrush information. The values present in pBrushDlgInfo when the function is called are used to initialize the dialog, if PAINT_DLG_BRUSH_INITUSEDEFAULT is not set in the dwFlags member of pBrushDlgInfo. When this function returns, this parameter is updated with the values entered through the dialog.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes |
Required DLLs and Libraries
This example will display the brush common dialog.
L_INT LRasterDialog_DoModalBrushExample( HWND hWnd, L_BOOL bUseDef )
{
L_INT nRet;
// this will call the default constructor and destructor when it is out of scope
LRasterDialog lRstDlg ;
L_TCHAR* ppszTouchImage [ ] = { TEXT("Image 0"), TEXT("Image 1"), TEXT("Image 2"), TEXT("Image 3"), TEXT("Image 4") } ;
PAINTDLGBRUSHINFO DlgBrushInfo ;
memset(&DlgBrushInfo,0,sizeof(PAINTDLGBRUSHINFO));
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 ;
}
nRet = lRstDlg.DoModalBrush ( hWnd, &DlgBrushInfo ) ;
if(nRet != SUCCESS)
return nRet;
return SUCCESS;
}