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 25-03-2004, 12:57
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,778
Blog Entries: 10
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default ApplyPatternFill

I am trying to apply a FullColorBitmap fill to an object. My question is one of optimization.

When you manually go to the Pattern Fill Dialog you can change Width, Height, Skew, Rotate all at one time and hit the OK button. The Pattern is then applied to the object. When you “undo” this fill it can be undone in one step.

When you do this via code there is one undo step for each change. See code:
Code:
Set pfGraniteFill = s.Fill.ApplyPatternFill(cdrBitmapPattern, Path & "\Wood13M.cpt", , , , True)

pfGraniteFill.TileHeight = 5 / s.AbsoluteHScale
pfGraniteFill.TileWidth = 5 / s.AbsoluteVScale
...
Is there a way to define all your settings first then apply them on a code level?

Hope that makes sense,

Shelby
Reply With Quote
  #2  
Old 26-03-2004, 08:22
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default Re: ApplyPatternFill

Shelby,

Unfortunately it is not possible yet. Hopefully in the next version. But for now, if you are concerned with just the Undo, then you can use Document.BeginCommandGroup and .EndCommandGroup functions which can group separate transactions in a single block:

Code:
ActiveDocument.BeginCommandGroup "Apply Pattern Fill"
Set pfGraniteFill = s.Fill.ApplyPatternFill(cdrBitmapPattern, Path & "\Wood13M.cpt", , , , True) 
pfGraniteFill.TileHeight = 5 / s.AbsoluteHScale 
pfGraniteFill.TileWidth = 5 / s.AbsoluteVScale 
ActiveDocument.EndCommandGroup
This will make your fill change as a single Undo record. It will still reapply the fill three times, so the performance will suffer, but at least your undo concern will be addressed.

I hope this help.
Reply With Quote
  #3  
Old 26-03-2004, 13:29
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,778
Blog Entries: 10
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Re: ApplyPatternFill

Thanks Alex. Please add this to the wish list for 13.

My concern is not so much the single undo, but performance. When you are filling several objects you start to notice the performance hit. Just trying to do things faster and better.

Thanks again for the help, you are amazing as always.

Shelby
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 17:47.


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