Solved

Smooth animation?

Posted on 1997-12-06
3
402 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

726 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