LRasterPaint::BrushMoveTo

#include "Ltwrappr.h"

L_INT LRasterPaint::BrushMoveTo(UserDC, nX, nY)

HDC UserDC;

handle to the device context

L_INT nX;

x position

L_INT nY;

y position

Updates the current position of the paintbrush and paints a single brush touch.

Parameter

Description

UserDC

Handle to a device context, such as a screen, to use as a display surface. This parameter can also be NULL. The mapping mode of the device context must be MM_TEXT.

nX

Specifies the x-coordinate of the new position.

nY

Specifies the y-coordinate of the new position.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes

Comments

The paintbrush touch will be drawn using the current paintbrush properties. To determine the current paintbrush properties, call LRasterPaint::GetProperty. To set or change the current paintbrush properties, call LRasterPaint::SetProperty. For more information on the paintbrush properties, refer to the PAINTBRUSH structure.

If UserDC is not NULL, the toolkit will paint the paintbrush touch on the specified device context. If UserDC is NULL, the paintbrush touch will not be painted on a device context.

If a bitmap has been set using the LRasterPaint::SetMetrics function, the paintbrush touch will be drawn on the specified bitmap. If UserDC is not NULL and a bitmap has been set using the LRasterPaint::SetMetrics function, then the paintbrush touch will be drawn to both the device context and the bitmap.

Required DLLs and Libraries

LTPNT

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions:

LRasterPaint::SetProperty, LRasterPaint::SetTransformation, LRasterPaint::SetClipRgn, LRasterPaint::SetMetrics, LRasterPaint::GetProperty, LRasterPaint::GetTransformation, LRasterPaint::GetClipRgn, LRasterPaint::BrushLineTo, Class Members

Topics:

Painting with a Brush

Example

L_INT LRasterPaint_BrushMoveToExample( CWnd* pWnd ) 
{ 
   L_INT          nRet; 
   LRasterPaint   rstp; 
   CDC*           pDC = pWnd->GetDC() ; 
   PAINTBRUSH     brush; 
   /* Initiate the Paint toolkit */ 
   nRet = rstp.Initialize ( ); 
   if(nRet != SUCCESS) 
      return nRet; 
   /* Get the current paintbrush properties */ 
   nRet = rstp.GetProperty (PAINT_GROUP_BRUSH, &brush ) ; 
   if(nRet != SUCCESS) 
      return nRet; 
   /* Set the required paintbrush properties */ 
   brush.nSize                = sizeof ( PAINTBRUSH ) ; 
   brush.dwMask               = PBF_DIAMETER | 
   PBF_TOUCH | 
   PBF_SPACING ; 
   brush.nDiameter            = 20 ; 
   brush.Touch.crColor        = RGB ( 255, 0, 0 ) ; 
   brush.nSpacing             = 25 ; 
   /* Set the new paintbruch properties */ 
   nRet = rstp.SetProperty (PAINT_GROUP_BRUSH, &brush ) ; 
   if(nRet != SUCCESS) 
      return nRet; 
   /* Use the current paintbruch properties to draw a paintbruch strock to DC (hDC) */ 
   nRet = rstp.BrushMoveTo ( pDC->m_hDC, 10, 10 ) ; 
   if(nRet != SUCCESS) 
      return nRet; 
   nRet = rstp.BrushLineTo ( pDC->m_hDC, 100, 100 ) ; 
   if(nRet != SUCCESS) 
      return nRet; 
   /* Free the paint tools handle */ 
   nRet = rstp.Free ( ) ; 
   if(nRet != SUCCESS) 
      return nRet; 
   pWnd->ReleaseDC( pDC ) ; 
   return SUCCESS ; 
} 

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS DigitalPaint C++ Class Library Help