Solved

Smooth animation?

Posted on 1997-12-06
3
397 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

744 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