Previous Document Next Document

Object Model Reference : Classes : P : PatternCanvas : Properties : PatternCanvas.Size


PatternCanvas.Size

Property Size As cdrPatternCanvasSize

Description

Member of PatternCanvas

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.

The Size property returns a value of cdrPatternCanvasSize.

VBA example

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

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.