Author |
Topic |
|
TuzhibaevTA
Russia
85 Posts |
Posted - 03/20/2005 : 08:14:37
|
Здравствуйте, Уважаемые! Мне необходимо нарисовать на листе кучу фигурок. Механизм впринципе готов, вопрос лишь в производительности. Слишком долго все выводится на экран. Я вот думаю, если на время операции не обновлять экран, может шустрее будет? Кто-нибудь знает как в Visio отключить это обновление?
Тужибаев Тимур |
|
Tumanov
Russia
1198 Posts |
Posted - 03/20/2005 : 17:29:58
|
Mai-lan в своем блоге по Visio собрала в кучку советы по этому поводу. Получается, что не столько тормозит прорисовка, сколько всевозможные вычисления. А их можно на время отключить. Нужный кусок я выделил
Wednesday, September 22, 2004 # Dev Luv: Visio Development Top Five Performance Tips Here are my favorite five recommendations for improving Visio performance in an app:
1. Get a Cell by its location rather than its name: Retrieve a cell by its Section, Row, and Cell location in the ShapeSheet using CellsSRC, rather than by Cell name. It also means that you’re more globalization-friendly (unless you’re using CellsU) since cell names are localized. Check the Visio Automation documentation for the CellsSRC method to find the Section, Row, and Cell indices. The Visio 2003 SDK has examples in the Code Librarian in C#, VB.NET, and VB for how to use CellsSRC. 2. Add multiple shapes in a single call: Rather than dropping individual shapes onto a page, use the DropMany or DropManyU methods. This is especially important for .NET solutions, since you want to minimize how many times you cross process boundaries. Drop Many/DropManyU drops multiple shapes on a page, in a master, or in a group. It returns an array of the IDs of the Shape objects it produces. The Visio 2003 SDK has examples in the Code Librarian in C#, VB.NET, and VB for how to use DropMany/DropManyU. 3. Set multiple formulas and results in a single call: SetFormulas and SetResults let you set multiple formulas and results (respectively) in one call. Again, this is important for .NET applications especially to minimize traffic across processes. To use this, you’ll need the shape ID's, which you can retrieve after calling DropManyU. Check the Visio 2003 SDK Code Librarian called "Get Many & Set Many Formulas" for a C#, VB.NET, and VB sample. 4. Defer the application’s recalc: Visio is one big recalc engine, and recalc is an expensive operation. Turn on Application.DeferRecalc so that the ShapeSheet does not recalculate each time that shapes are dropped or cells have changed. Remember to turn off the property after you get done with your bulk drawing creation or edits. 5. Drop all shapes first to any random location: It is faster to drop all your shapes in a random location on a page and then reposition them as needed.
|
|
|
|
Topic |
|
|
|