API Documentation > CorelDRAW > 2025-v26 > PatternCanvas > IVGPatternCanvas
PatternCanvas.Width property
Gets or sets the Width
Syntax:
Property Get Width() As Long
Property Let Width(ByVal Value As Long)
Remarks:
The Width property returns or specifies the horizontal size of a pattern canvas. Allowed values range from 1 to 256 pixels.
Examples:
The following VBA example creates a small bitmap pattern that is 2 × 2 pixels in size. The upper-left and lower-right pixels are set to black, creating a checkerboard pattern.
Sub Test()
Dim c As New PatternCanvas
c.Width = 2
c.Height = 2
c.Clear
c.PSet (0, 0)
c.PSet (1, 1)
With ActiveLayer.CreateRectangle(0, 0, 3, 3)
  .Fill.ApplyPatternFill cdrTwoColorPattern
  .Fill.Pattern.Canvas = c
End With 
End Sub