OberonPlace.com Forums

OberonPlace.com Forums (http://forum.oberonplace.com/index.php)
-   Corel Photo-Paint VBA (http://forum.oberonplace.com/forumdisplay.php?f=17)
-   -   I need to update objects visibility faster (http://forum.oberonplace.com/showthread.php?t=199)

NEHovis 18-07-2003 07:54

I need to update objects visibility faster
' The question that I have is this: With my lookup table containing the
'object number and the visibility status, is there a way to update all
'objects visibility property and then do a "refresh" on the objects? (I am
'hoping that the time to refresh will be on the order of the
'PHOTOPAINT.CorelScript.ObjectVisible 1, 80, False command) In this
'example the time difference is not too bad. In my application, I have
'over 1000 objects which takes close to an hour and I need to repeat this
'process 5,000 - 10,000 times.
'I was not able to upload my program. To execute this code, in a new
'project, add 80 objects. In VB add two command buttons and two
'labels. The two buttons toggle the objects on and off and the labels to
'display the time.

Dim obj_ctr As Long
Dim Start, Finish, TotalTime

Private Sub CommandButton1_Click()
Start = Timer ' Note: The timer here is just to measure the response time.

' This line of code is processed very fast. In my actual program, this
'line updates all of the objects just about as fast. The problem
'that I have is that not all of my objects are all off or on. They are mixed.

PHOTOPAINT.CorelScript.ObjectVisible 1, 80, False

Finish = Timer
TotalTime = Finish - Start
Label2.Caption = TotalTime

End Sub

Private Sub CommandButton2_Click()
Start = Timer
' Note: In my code, I will change the visibility requirement for each
'object. This will be maintained in a lookup table (2-D Array ; object
'number, visibility: 1 on - 0 off)

For obj_ctr = 1 To 80

' Note: In the actual code, I have conditional statements and a
'lookup table to determine if this line of code is activated. If the lookup
'table for obj_ctr number 5 is to be on then this line would be activated.
'Please note that the process time to make the decisions in the actual
'program is fast. My problem comes in when I update the objects
'visibility. I also found that there is no difference in time from turning the
'objects on verses off.

PHOTOPAINT.CorelScript.ObjectVisible obj_ctr, obj_ctr, True

'Note: If you remove the comment on the DoEvents command, you
'will see the objects update one at a time. This will slow down the update
'time as well.


Next obj_ctr

Finish = Timer
TotalTime = Finish - Start
Label2.Caption = TotalTime

End Sub

All times are GMT -5. The time now is 19:11.

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