Board index » cppbuilder » How to Paint an Animation over another Animation

How to Paint an Animation over another Animation

Hello,

I'm programming a Screensaver... There should walk much animals over
a background. Now the problem is, this animations should walk about each

other.
I'd like to have about 20 animals who walks over the screen.

It's me possible to make it with BitBlt, but there I have the problem,
that
the animations cant walk about each other. I mad for each animation
a thread, so the thread who paints last was on top (over the other
animation).
And I only copy a square, so my way don't works...

how I realized it....

  BitBlt(BitmapTemp->Canvas->Handle, 0, 0, iB, iH,
Form1->ImageBackground->Canvas->Handle, iX, iY, SRCCOPY);
  BitBlt(BitmapTemp->Canvas->Handle, 0, 0, iB, iH,
Form1->BitmapSnake->Picture->Bitmap->Canvas->Handle, iB*1, 131, SRCAND);

  BitBlt(BitmapTemp->Canvas->Handle, 0, 0, iB, iH,
Form1->BitmapSnake->Picture->Bitmap->Canvas->Handle, iB*1, 0,
SRCINVERT);
  BitBlt(Form1->PaintBox1->Canvas->Handle, iX, iY, iB, iH,
BitmapTemp->Canvas->Handle, 0, 0, SRCCOPY);

Has somebody an idea, how to realisize it, without DirectX?

                                                bye
                                                Gilbert

 

Re:How to Paint an Animation over another Animation


Here's a relatively ugly but effective approach. Try sliding a bunch of
TImages around the screen. Set the Transparent property and you should be in
business!
Quote
Onkel Gilbert <OnkelGilb...@Beer.com> wrote in message

news:390ADC46.2E5BDF5B@Beer.com...
Quote
> Hello,

> I'm programming a Screensaver... There should walk much animals over
> a background. Now the problem is, this animations should walk about each

> other.
> I'd like to have about 20 animals who walks over the screen.

> It's me possible to make it with BitBlt, but there I have the problem,
> that
> the animations cant walk about each other. I mad for each animation
> a thread, so the thread who paints last was on top (over the other
> animation).
> And I only copy a square, so my way don't works...

> how I realized it....

>   BitBlt(BitmapTemp->Canvas->Handle, 0, 0, iB, iH,
> Form1->ImageBackground->Canvas->Handle, iX, iY, SRCCOPY);
>   BitBlt(BitmapTemp->Canvas->Handle, 0, 0, iB, iH,
> Form1->BitmapSnake->Picture->Bitmap->Canvas->Handle, iB*1, 131, SRCAND);

>   BitBlt(BitmapTemp->Canvas->Handle, 0, 0, iB, iH,
> Form1->BitmapSnake->Picture->Bitmap->Canvas->Handle, iB*1, 0,
> SRCINVERT);
>   BitBlt(Form1->PaintBox1->Canvas->Handle, iX, iY, iB, iH,
> BitmapTemp->Canvas->Handle, 0, 0, SRCCOPY);

> Has somebody an idea, how to realisize it, without DirectX?

>                                                 bye
>                                                 Gilbert

Other Threads