Previous Document Next Document
PatternCanvas.FillArea

Sub FillArea(x1 As Long, y1 As Long, x2 As Long, y2 As Long, [State As Boolean = True])

Member of PatternCanvas

The FillArea method fills a rectangular area of a pattern canvas with black or white pixels.

See also the Line method.

Parameters
Description
x1
Specifies the x-coordinate for the first point that defines the area to fill on the pattern canvas. This value is measured in document units.
y1
Specifies the y-coordinate for the first point that defines the area to fill on the pattern canvas. This value is measured in document units.
x2
Specifies the x-coordinate for the second point that defines the area to fill on the pattern canvas. This value is measured in document units.
y2
Specifies the y-coordinate for the second point that defines the area to fill on the pattern canvas. This value is measured in document units.
State
Determines whether the filled area is returned to its original state after the fill is removed on the pattern canvas. If the value is True, the area is returned to its original state.
This parameter is optional, and its default value is True.

The following code example creates a pattern of two overlapping, filled rectangles with an unfilled area at their intersection:

Sub Test() 
 Dim c As New PatternCanvas 
 c.Size = cdrPatternCanvas32x32 
 c.FillArea 0, 0, 31, 31, True 
 c.FillArea 0, 0, 18, 18, False 
 c.FillArea 14, 14, 31, 31, False 
 c.FillArea 14, 14, 18, 18, True 
 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.