Previous Document Next Document

Object Model Reference : Classes : P : PatternCanvas : Methods : PatternCanvas.RotateArea


PatternCanvas.RotateArea

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

Description

Member of PatternCanvas

The RotateArea method rotates an area, as 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°).

Parameter
Description
x1
Specifies the x-coordinate of 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 of 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 of 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 of 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, at which to rotate the pattern canvas

VBA example

The following VBA 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 2013 Corel Corporation. All rights reserved.