API Documentation > CorelDRAW > 2025-v26 > PatternCanvas > IVGPatternCanvas
PatternCanvas.FillArea method
Fills the Area (x1,y1)-(x2,y2)
Syntax:
Sub FillArea(ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long, Optional ByVal State As Boolean = True)
Parameters:
Name Type Description
x1
Long
y1
Long
x2
Long
y2
Long
State
Boolean
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.
Remarks:
The FillArea method fills a rectangular area of a pattern canvas with black or white pixels. See also the PatternCanvas.Line method.
Examples:
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