Solved

Smooth animation?

Posted on 1997-12-06
3
399 Views
Last Modified: 2012-08-13
I have found a source code demo of smooth animation.
Basically it use bitblt to do copy , and , xor operation
on background and src bitmaps.
   
BitBlt picSave.hdc, 0, 0, 60, 60, picDest.hdc, cx, cy, vbSrcCopy ' save bkgrnd
BitBlt picDest.hdc, cx, cy, 60, 60, picMask.hdc, 0, 0,
vbSrcAnd   ' and mask
BitBlt picDest.hdc, cx, cy, 60, 60, picSrc.hdc, 0, 0,
vbSrcInvert        ' xor source
   
The src and mask bitmap looks right to me.  But when I
run the program , the supposed moving image ( a coin) is
messed with other colors. Seems and , xor opertion not
right. Is there any suggestion?
Thanks.
   
0
Comment
Question by:xzhang
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
kesonline earned 30 total points
ID: 1443949
The two images have to have the same color palettes as all the other bitmaps in your particular form. That is probably the culprit.
ALSO
vbSrcInvert doesn't look like xor to me - it looks like invert. Just as a refresher, put up a comment with the values.
0
 

Author Comment

by:xzhang
ID: 1443950
Thank you very much. vbSrcInvert does stand for xor.
Could you tell me the way to change two bitmap so that
they have same palettes?


0
 
LVL 1

Expert Comment

by:kesonline
ID: 1443951
Yes - bring up an image editor like PhotoShop or PhotoStyler. Open 1 of the images...save the palette. Now open the other image, load the palette into that image, and save. I think that should do it. Email them to me if you can't do it (ben@kescom.net)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now