|
-
Aug 6th, 2000, 09:15 PM
#1
I'm looking for speed here, and I need to refresh a picturebox as fast as possible.
Please post any alternatives to the .Refresh property!! 
Thanks,
Jordan
-
Aug 7th, 2000, 12:45 PM
#2
-
Aug 7th, 2000, 01:03 PM
#3
Frenzied Member
there's the redraw window API, it may be slightly faster
Code:
Declare Function RedrawWindow Lib "user32" Alias (ByVal hwnd As Long, lprcUpdate As RECT, ByVal hrgnUpdate As Long, ByVal fuRedraw As Long) As Long
I've never bothered using it before so I don't know exactly how, I recon you can Ignore hRgnUpdate and fuRedraw, and that hWnd is the hWnd of the picture box you need to refresh and lprcUpdate is the rectangle you want to update (so you don't have to refresh the whole thing) if you set lprcUpdate to 0 then it'll probably do the whole thing.
-
Aug 7th, 2000, 01:25 PM
#4
Fanatic Member
Yeah, If you set lprcUpdate to vbNull, hrgnUpdate to vbNull and fuRedraw to 0, it redraws the entire client area. It might be faster to update just a rectangle (in lprcUpdate), but this depends on what you are doing.
-
Aug 8th, 2000, 09:16 AM
#5
Send the WM_PAINT message. It's 3-4 times faster.
Code:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Const WM_PAINT = &HF
Private Sub Command1_Click()
SendMessage Picture1.hwnd, WM_PAINT, Picture1.hDC, 0
End Sub
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
|