OberonPlace.com Forums

OberonPlace.com Forums (http://forum.oberonplace.com/index.php)
-   CorelDRAW/Corel DESIGNER VBA (http://forum.oberonplace.com/forumdisplay.php?f=16)
-   -   nonproportional sizing/scaling (http://forum.oberonplace.com/showthread.php?t=732)

olympiatr 03-11-2004 04:49

nonproportional sizing/scaling
 
Dim s1 As Shape
Set s1 = ActiveLayer.CreateRectangle(1.819732, 9.217031, 6.447984, 3.054413)
s1.Fill.ApplyNoFill
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...

Alex 03-11-2004 12:04

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:

Code:

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

Code:

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.

olympiatr 04-11-2004 02:44

thank you
 
thanx a lot... ;)


All times are GMT -5. The time now is 15:45.

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