Animated Bitmaps
Animated Bitmaps
I'm trying to add support for bitmap animations inside a TRichViewEdit component. I have four bitmap images I would like to cycle through to create the effect of a simple animation. How might I go about this -- is it possible to do. Note, this animation effect is not using animated gifs. Any ideas would be greatly appreciated.
-
- Site Admin
- Posts: 17528
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Bitmap animation is supported.
Set the following integer properties (see SetItemExtraIntProperty):
rvepImageWidth,
rvepImageHeight,
rvepAnimationInterval.
Bitmap is sliced into frames (rvepImageWidth x rvepImageHeight) arranged in rows and columns. Animation is enabled if you set rvepAnimationInterval in positive value (animation delay in 1/100 of second)
Known problems: such bitmaps are still printed and exported stretched instead of exporting one frame.
Set the following integer properties (see SetItemExtraIntProperty):
rvepImageWidth,
rvepImageHeight,
rvepAnimationInterval.
Bitmap is sliced into frames (rvepImageWidth x rvepImageHeight) arranged in rows and columns. Animation is enabled if you set rvepAnimationInterval in positive value (animation delay in 1/100 of second)
Known problems: such bitmaps are still printed and exported stretched instead of exporting one frame.
Sergey,
I tried your recommendation to use rvepAnimationInterval but it doesn't work. Here is my code:
What this produces is a static (non-animated) bitmap image the size of rvepImageWidth/Height with all four tiled bitmap images (so they have been shruken). The rvepAnimationInterval doesn't seem to work. What might I be doing wrong?
I tried your recommendation to use rvepAnimationInterval but it doesn't work. Here is my code:
Code: Select all
Graphics::TBitmap *bigBmp = new Graphics::TBitmap;
bigBmp->Canvas->CopyMode = cmSrcCopy;
bigBmp->SetSize(animBmp[0]->Width*2,animBmp[0]->Height*2);
bigBmp->Canvas->Draw(0,0,animBmp[0]);
bigBmp->Canvas->Draw(0,animBmp[0]->Width,animBmp[1]);
bigBmp->Canvas->Draw(animBmp[0]->Height,0,animBmp[2]);
bigBmp->Canvas->Draw(animBmp[0]->Height,animBmp[0]->Width,animBmp[3]);
RichViewEdit1->InsertPicture("", bigBmp, rvvaBaseline);
RichViewEdit1->SetCurrentItemExtraIntProperty(rvepImageWidth, animBmp[0]->Width, true);
RichViewEdit1->SetCurrentItemExtraIntProperty(rvepImageHeight, animBmp[0]->Height, true);
RichViewEdit1->SetCurrentItemExtraIntProperty(rvepAnimationInterval, 50, true);
-
- Site Admin
- Posts: 17528
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I just set this as well but I get the same result
New code snippet with line added below:
New code snippet with line added below:
Code: Select all
Graphics::TBitmap *bigBmp = new Graphics::TBitmap;
bigBmp->Canvas->CopyMode = cmSrcCopy;
bigBmp->SetSize(animBmp[0]->Width*2,animBmp[0]->Height*2);
bigBmp->Canvas->Draw(0,0,animBmp[0]);
bigBmp->Canvas->Draw(0,animBmp[0]->Width,animBmp[1]);
bigBmp->Canvas->Draw(animBmp[0]->Height,0,animBmp[2]);
bigBmp->Canvas->Draw(animBmp[0]->Height,animBmp[0]->Width,animBmp[3]);
RichViewEdit1->InsertPicture("", bigBmp, rvvaBaseline);
RichViewEdit1->SetCurrentItemExtraIntProperty(rvepImageWidth, animBmp[0]->Width, true);
RichViewEdit1->SetCurrentItemExtraIntProperty(rvepImageHeight, animBmp[0]->Height, true);
RichViewEdit1->SetCurrentItemExtraIntProperty(rvepAnimationInterval, 50, true);
RichViewEdit1->AnimationMode = rvaniOnFormat;
-
- Site Admin
- Posts: 17528
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Oops, there is a bug preventing bitmap animation to work
If you are a registered user, I can give you instructions how to fix it. If not, and this functionality is critical for you, I can send updated trial to you.
All changes not included in the help file are listed in readme.txt, in the same folder as the help file.
If you are a registered user, I can give you instructions how to fix it. If not, and this functionality is critical for you, I can send updated trial to you.
All changes not included in the help file are listed in readme.txt, in the same folder as the help file.
-
- Site Admin
- Posts: 17528
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17528
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17528
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: