OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Thread Tools Search this Thread Display Modes
Old 03-11-2004, 04:49
Posts: n/a
Default nonproportional sizing/scaling

Dim s1 As Shape
Set s1 = ActiveLayer.CreateRectangle(1.819732, 9.217031, 6.447984, 3.054413)
s1.Outline.SetProperties 0.003, OutlineStyles(0), CreateCMYKColor(0, 0, 0, 100), ArrowHeads(0), ArrowHeads(0), False, False, cdrOutlineButtLineCaps, cdrOutlineMiterLineJoin, 0#, 100
ActiveDocument.ReferencePoint = cdrCenter
'this is without "nonproportional 'sizing/scaling
s1.SetSize 4.724409, 6.496063
'and this is with "nonproportional 'sizing/scaling
s1.SetSize 5.905512, 8.120079

as you see the codes above, it is writin second value (with nonproportional "s1.SetSize 5.905512, 8.120079"after comma) for my opinion it shouldn't write a value. cause i give a first value "5.905512" by pressing "nonproportional sizing/scaling" button and it have to give second value automatically isn't it? thanx much for answer...
Reply With Quote
Old 03-11-2004, 12:04
Alex's Avatar
Alex Alex is offline
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default Re: nonproportional sizing/scaling

VBA recorder isn't smart enough to recognize the actual stretching mode. It just specifies both horizontal and vertical dimensions of the new object.

However, the method SetSize itself is capable of calculating the missing parameter to keep the object size constrained. Just modify your recorded macro like this:

s1.SetSize 5
To make the object to be scaled to 5" wide and keep the height proportional, or:

s1.SetSize , 8
to make the height of the object to be 8" and recalculate the width.

If you specifies both the width and the height, the object is stretched unproportionally.
Reply With Quote
Old 04-11-2004, 02:44
Posts: n/a
Default thank you

thanx a lot...
Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 20:03.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com