Previous Document Next Document
PatternCanvas.PSet

Sub PSet(Step As Integer, x As Long, y As Long, Color As Boolean)

Member of PatternCanvas

The PSet method sets a pixel of a given color at a specified coordinate on a pattern canvas. If set to True, the pixel represents white. If set to False, the pixel represents black.

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

See also the Pixel property.

Parameters
Description
Step
Identifies the number of bands (steps)
x
Specifies the horizontal position for a point on the pattern canvas. This value is measured in document units.
y
Specifies the vertical position for a point on the pattern canvas. This value is measured in document units.
Color
Indicates whether the pixel 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 pixel.

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.