Previous Document Next Document

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


PatternCanvas.FillArea

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

Description

Member of PatternCanvas

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

 
See also the PatternCanvas.Line method.

Parameter
Description
x1
Specifies the x-coordinate of 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 of 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 of 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 of the second point that defines the area to fill on the pattern canvas. This value is measured in document units.
State
Specifies 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.

VBA example

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