|
-
Oct 1st, 2000, 12:27 AM
#1
Thread Starter
Member
I've been trying animation in VB. I wanted an image to move across the screen. Well, that was easy. But, I wanted the image to have a transparent background (so it would have the same background as the screen), so, using LView, I gave it a transparent background. But now the image flickers as it moves.
Any work-arounds? Any other ways of having a cartoon image 'walk' across the screen?
-
Oct 2nd, 2000, 12:57 PM
#2
Fanatic Member
There is only 1 way to accomplish this: BitBlt
You have to use BitBlt together with the background in a memory DC.
1) Keep the background in memory
2) Draw the picture on the screen in a transparent way, therefore you'll need a mask color. Use the Blt constants vbMergePaint and vbAnd when using vbWhite as the mask color.
3) When moving the picture, do the following:
* restore the background by getting the dimensions from the memory DC. But DON'T blt the whole picture size, otherwise, you'll get flicker! Just blt the parts from the background that were covered at the previous location. So, always keep track of the previous XY-location.
* Goto 2)
-
Oct 2nd, 2000, 08:54 PM
#3
Thread Starter
Member
Say what?
Sounds hard. Hmmmmmmmm. Can't we use animated gifs in VB?
-
Oct 5th, 2000, 02:14 PM
#4
Fanatic Member
Yes, there a lot of .OCX available on the net. Don't ask me where or which one, because I don't use them at all. These controls are mostly all right to put something on the screen, but also too slow to move something on the screen, especially when the image has to be transparent.
I always write my own algorithms to get what I want. Unfortunately I don't get it all the time...
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
|