OberonPlace.com Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-11-2004, 05:49
olympiatr
Guest
 
Posts: n/a
Default 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...
Reply With Quote
  #2  
Old 03-11-2004, 13:04
Alex's Avatar
Alex Alex is offline
Administrator
 
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:

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.
Reply With Quote
  #3  
Old 04-11-2004, 03:44
olympiatr
Guest
 
Posts: n/a
Default thank you

thanx a lot...
Reply With Quote
Reply


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 00:27.


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