API Documentation > CorelDRAW > 2025-v26 > PatternCanvas > IVGPatternCanvas
PatternCanvas.Size property
Gets or sets the Size
Syntax:
Property Get Size() As cdrPatternCanvasSize
Property Let Size(ByVal Value As cdrPatternCanvasSize)
Remarks:
The Size property returns or specifies one of the standard canvas sizes (16 × 16, 32 × 32, or 64 × 64 pixels). Any other sizes are treated as custom sizes. Instead of setting the values of the Width and Height properties, you can use the Size property to set both dimensions to one of the standard values.
Examples:
The following VBA example creates a new pattern canvas that is 64 × 64 pixels and then applies it to a rectangle.
Sub Test()
Dim c As New PatternCanvas
Dim x As Long, y As Long
c.Size = cdrPatternCanvas64x64
c.Clear
For x = 0 To c.Width - 1
  For y = 0 To c.Height - 1

 c.Pixel(x, y) = (((x + y) \ 2) Mod 2) <> 0
  Next y
Next x
With ActiveLayer.CreateRectangle(0, 0, 2, 2)
  .Fill.ApplyPatternFill cdrTwoColorPattern
  .Fill.Pattern.Canvas = c
End With 
End Sub