Adds a PatternCanvas to the PatternCanvases collection
Syntax:
Function Add(ByVal PatternCanvas As PatternCanvas) As Long
Parameters:
Name Type Description
PatternCanvas
Remarks:
The Add method adds a two-color fill pattern to the PatternCanvases collection. The additional pattern is added to the 2-color list box in the Pattern Fill dialog box. You can apply a pattern canvas without adding it to the PatternCanvases collection. See also the example for the PatternCanvases.Item property.
Examples:
The following VBA example creates a pattern on a new 64 × 64 bitmap and adds it to the list of available two-color fills. It then applies the fill pattern to a newly created rectangle.
Sub Test()
Dim c As New PatternCanvas
Dim n As Long
c.Size = cdrPatternCanvas64x64
c.Clear
For n = 2 To 63 Step 2
  c.Line (0, 0)-(n, n), , B
Next n
On Error Resume Next ' The code in green is a workaround.
n = PatternCanvases.Add(c)
If Err.Number Then n = PatternCanvases.Add(c)
  On Error GoTo 0
  With ActiveLayer.CreateRectangle(0, 0, 3, 3)

 .Fill.ApplyPatternFill cdrTwoColorPattern, , n
  End With

End Sub