Partager via


Draw Method [InkOverlay Class]

Draw Method [InkOverlay Class]

Sets a rectangle in which to redraw the ink within the InkOverlay object.

Declaration

[C++]

HRESULT Draw ([in] IInkRectangle* rDrawRect);

[Microsoft® Visual Basic® 6.0]

Public Sub Draw(rDrawRect As InkRectangle)

Parameters

rDrawRect

[in] Specifies the rectangle on which to draw, in pixel coordinates. When this parameter is NULL, the entire window is redrawn.

Remarks

InkDisp within the rectangle represented by rDrawRect is drawn when the area is next repainted if the AutoRedraw property is True.

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example creates an InkOverlay object and allows the user to ink in it, then redraw a portion of the ink within a specific rectangle when the Draw method is invoked by pressing a command button. This application starts with a standard .exe application and adds a reference to the Tablet PC Type Library, a command button, Command1, then adds the following code to the form.

        Option Explicit
Private WithEvents theInkOverlay As InkOverlay
Dim theDrawFlag As Boolean

Private Sub Command1_Click()
    Dim theInkRectangle As New InkRectangle
    theInkRectangle.SetRectangle 20, 20, 180, 180
    Refresh
    theDrawFlag = True
    theInkOverlay.Draw theInkRectangle
End Sub

Private Sub Form_Load()
    Me.ScaleMode = vbPixels
    Set theInkOverlay = New InkOverlay
    theInkOverlay.hWnd = Me.hWnd
    theInkOverlay.Enabled = True
    theDrawFlag = False
End Sub

Private Sub theInkOverlay_Painting( _
ByVal hDC As Long, _
ByVal Rect As MSINKAUTLib.IInkRectangle, _
Allow As Boolean)
    Allow = theDrawFlag
    theDrawFlag = False
End Sub
      

Applies To