Previous Document Next Document
PatternCanvas.Size

Property Size As cdrPatternCanvasSize

Member of PatternCanvas

The Size property returns or sets 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.

The following code example creates a new pattern canvas that is 64 ?64 pixels and 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 2007 Corel Corporation. All rights reserved.