|
-
Jan 1st, 2000, 03:26 PM
#1
Thread Starter
New Member
I am using the following VB code to display the bitmap into an image control. I am taking the values of each pixel from the bitmap file , do some processing, and finally plot each individual pixel on to the image control.Take a look at it.
For x = 1 To head.width
For y = 1 To head.height
img1.PSet (x, y), RGB(r,g,b)
Next y
Next x
The problem with this code is, the user cannot do anything when the bitmap is being displayed, while control is in this loop. I want to give a cancel button to stop the display of the bitmap ie. exit from this loop. Is there a method for this ?
Alternatively, it would be nice if there is a method to speed up the display of the bitmap,like writing the pixel array directly to video memory. [ Using VB only, not using directx ] .In this way, the need for the cancel button would be eliminated.
-
Jan 1st, 2000, 03:37 PM
#2
Guru
a DoEvents in the middle of the loop will allow the app to yield to the O/S (and therefore the user).
You could also use the LoadPicture function which would be much faster....
Tom
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
|