Previous Document Next Document

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


Layer.CreateRectangle

Function CreateRectangle(Left As Double, Top As Double, Right As Double, Bottom As Double, [CornerUL As Long], [CornerUR As Long], [CornerLR As Long], [CornerLL As Long]) As Shape

Description

Member of Layer

The CreateRectangle method creates a rectangle at a specified location on a layer.

This method uses the coordinates of the upper-left and lower-right corners of the rectangle as parameters and, optionally, the roundness of each corner.

Parameter
Description
Left
Specifies the distance from the left side of the rectangle to the left side of the page frame. This value is measured in document units.
Top
Specifies the distance from the top of the rectangle to the top of the page frame. This value is measured in document units.
Right
Specifies the distance from the right side of the rectangle to the right side of the page frame. This value is measured in document units.
Bottom
Specifies the distance from the bottom of the rectangle to the bottom of the page frame. This value is measured in document units.
CornerUL
Specifies the roundness measurement of the upper-left corner of the rectangle. Values range between 0 and 100. This parameter is optional, and its default value is 0.
CornerUR
Specifies the roundness measurement of the upper-right corner of the rectangle. Values range between 0 and 100. This parameter is optional, and its default value is 0.
CornerLR
Specifies the roundness measurement of the lower-right corner of the rectangle. Values range between 0 and 100. This parameter is optional, and its default value is 0.
CornerLL
Specifies the roundness measurement of the lower-left corner of the rectangle. Values range between 0 and 100. This parameter is optional, and its default value is 0.

 
When you round the corners of a rectangle, CorelDRAW splits each corner node in two and draws an arc between each of these two new nodes.
VBA example

The following VBA example creates a 5" square with 20% corner roundness (that is, a corner radius of 0.5").

Sub Test()
 ActiveLayer.CreateRectangle 0, 0, 5, 5, 20, 20, 20, 20
End Sub

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.