Previous Document Next Document

Object Model Reference : Classes : P : PatternCanvas : Methods : PatternCanvas.Line


PatternCanvas.Line

Sub Line(Flags As Integer, x1 As Long, y1 As Long, x2 As Long, y2 As Long, Color As Boolean)

Description

Member of PatternCanvas

The Line method draws a line, or a rectangle that is either filled or unfilled.

 
See also the PatternCanvas.FillArea method.
 
For detailed descriptions of the parameters for this function, see the Visual Basic Help.

Parameter
Description
Flags
x1
Specifies the x-coordinate of the starting point of the new line on the canvas. This value is measured in document units.
y1
Specifies the y-coordinate of the starting point of the new line on the canvas. This value is measured in document units.
x2
Specifies the x-coordinate of the ending point of the new line on the canvas. This value is measured in document units.
y2
Specifies the y-coordinate of the ending point of the new line on the canvas. This value is measured in document units.
Color
Specifies whether the new line has a color applied to it on the pattern canvas. If this value is set to True, the selected color in the active color palette is applied to the new line.

VBA example

The following VBA example creates a pattern consisting of a diagonal line, an unfilled rectangle, and two pixels in the upper-right and lower-left corners of the canvas.

Sub Test()
 Dim c As New PatternCanvas
 c.Size = cdrPatternCanvas32x32
 c.Clear
 c.Line (0, 0)-(31, 31)
 c.Line (5, 5)-(27, 27), , B
 c.PSet (30, 2)
 c.PSet (2, 30)
 With ActiveLayer.CreateRectangle(0, 0, 2, 2)
  .Fill.ApplyPatternFill cdrTwoColorPattern
  .Fill.Pattern.Canvas = c
 End With
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.