Previous Document Next Document
PatternCanvas.Line

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

Member of PatternCanvas

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

See also the Visual Basic Help for detailed descriptions of parameters for this function.

See also the FillArea method.

Parameters
Description
Flags
x1
Specifies the x-coordinate for the starting point of the new line on the canvas. This value is measured in document units.
y1
Specifies the y-coordinate for the starting point of the new line on the canvas. This value is measured in document units.
x2
Specifies the x-coordinate for the ending point of the new line on the canvas. This value is measured in document units.
y2
Specifies the y-coordinate for the ending point of the new line on the canvas. This value is measured in document units.
Color
Determines 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.

The following code 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 2007 Corel Corporation. All rights reserved.