Previous Document Next Document

Object Model Reference : Classes : L : Layer : Methods : Layer.CreateRectangle2


Layer.CreateRectangle2

Function CreateRectangle2(x As Double, y As Double, Width As Double, Height As Double, [RadiusUL As Double], [RadiusUR As Double], [RadiusLR As Double], [RadiusLL As Double]) As Shape

Description

Member of Layer

The CreateRectangle2 method creates a rectangle, at a specified location on a layer, by using the coordinates for the upper-left corner, the width, the height, and the corner radii.

Parameter
Description
x
Specifies, in document units, the horizontal position of the upper-left corner coordinate
y
Specifies, in document units, the vertical position of the upper-left corner coordinate
Width
Specifies the horizontal measurement in document units
Height
Specifies the vertical measurementin document units
RadiusUL
Specifies the actual corner radius measurement of the upper-left corner. This parameter is optional, and its default value is 0.
RadiusUR
Specifies the actual corner radius measurement of the upper-right corner. This parameter is optional, and its default value is 0.
RadiusLR
Specifies the actual corner radius measurement of the lower-right corner. This parameter is optional, and its default value is 0.
RadiusLL
Specifies the actual corner radius measurement of the lower-left corner. This parameter is optional, and its default value is 0.

VBA example

The following VBA example creates a blend between two rectangles. The intermediate blend objects are rotated by 360° during the progression.

Sub Test()
 Dim s1 As Shape, s2 As Shape
 Set s1 = ActiveLayer.CreateRectangle2(0, 0, 3, 1)
 s1.Fill.UniformColor.RGBAssign 255, 0, 0
 Set s2 = ActiveLayer.CreateRectangle2(4, 4, 3, 1)
 s2.Fill.UniformColor.RGBAssign 255, 255, 0
 With s2.CreateBlend(s1).Blend
  .Loop = False
  .Angle = 360
 End With
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.