Previous Document Next Document
PatternCanvas.RotateArea

Sub RotateArea(x1 As Long, y1 As Long, x2 As Long, y2 As Long, Angle As Double)

Member of PatternCanvas

The RotateArea method rotates an area, defined by two coordinates, of a pattern canvas. The rotation is measured in degrees. Currently, only integer angle values divisible by 90 can be used (for example, 0, 90, 180, and 270).

Parameters
Description
x1
Specifies the x-coordinate for the first point that defines the area to rotate on the pattern canvas. This value is measured in document units.
y1
Specifies the y-coordinate for the first point that defines the area to rotate on the pattern canvas. This value is measured in document units.
x2
Specifies the x-coordinate for the second point that defines the area to rotate on the pattern canvas. This value is measured in document units.
y2
Specifies the y-coordinate for the second point that defines the area to rotate on the pattern canvas. This value is measured in document units.
Angle
Specifies the angle, measured in degrees, that the pattern canvas area is rotated.

The following code example creates a new fill by rotating the default brick pattern by 90?

Sub Test() 
 Dim c As New PatternCanvas 
 c.PutCopy PatternCanvases(4) 
 c.RotateArea 0, 0, c.Width - 1, c.Height - 1, 90 
 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.