|
-
Oct 18th, 2000, 07:24 AM
#1
I'm using bitblt for some animation in my program:
Call BitBlt(picStocksBuffer.hdc, 0, i% * iRowHeight, 600, iRowHeight, mvarRowPicture(iIndex).hdc, 0, 0, SRCCOPY)
Basically, I'm copying the picture of mvarRowPicture(iIndex) to the picture of picStocksBuffer (which are both pictureboxes).
Now when I execute this code in an .ocx usercontrol (with the pictureboxes on the usercontrol) instead of my standard form, it is slower about TEN times ! (about 0.08sec instead of 0.009 on the standard form).
Anybody has an explanation for this ?
Thanks a lot,
Felix
-
Oct 18th, 2000, 08:06 AM
#2
transcendental analytic
Autoredraw - Refesh problem, Do you use the exact same code for both form and control, and have autoredraw removed on both? Note Autoredraw may cause a huge message queue if you use bitblt frequently, that can't be cleaned with even thousands of doevents.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Oct 18th, 2000, 08:31 AM
#3
exact same code and autoredraw disabled everywhere... (all pictureboxes, the form and the usercontrol)
Felix
-
Oct 18th, 2000, 09:07 AM
#4
TO KEDAMEN:
Upps... just noticed that the SOURCE picturebox had AutoRedraw = True ...
However, when I set either
a) Set AutoRedraw = True. Then set AutoRedraw = False before BitBlt and back to True right after that
or
b) Set AutoRedraw = False. Then set AutoRedraw = true before painting the stuff and then back to false right after painting
the bitblt process goes about 3 times faster BUT I don't see the painted stuff...
Any idea? Need "picturebox.refresh" somewhere?
Thanks,
Felix
-
Oct 18th, 2000, 11:29 AM
#5
transcendental analytic
usercontrol.Refresh
YEah, put that after the last sequence of your blitting procedures, Why do you set autoredraw to the source objects? I mean you can make them persistant by setting their picture property to their image property. I'm not sure but you can also save time by changing clipcontrols to false on the usercontrol and the controls on it.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Oct 19th, 2000, 03:40 AM
#6
"setting their picture property to their image property" doesn't have any effect... maybe because the SOURCE picturebox is not visible (left=10000 pixels) ?
for your information: clip controls to false does not have any effect, too.
Thanks for your help!
Felix
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|