Page 1 of 1
ANI-GIF -vs- dynamik RV ?
Posted: Thu Mar 08, 2007 9:30 pm
by skydiablo
hi (sorry for my bad english!)
i have a RV in a class and create the RV on runtime. but now the GIF animations dont work ? i have added the unit "RVJvGifAnimate" in the uses and set fRichView.AnimationMode := rvaniOnFormat ...
whats happend ?
thx & greez, sky...
Posted: Fri Mar 09, 2007 8:23 am
by Sergey Tkachenko
They must work (if you use TJvGIFImage to add gifs).
Can you send me a simple project reproducing the problem?
Posted: Fri Mar 09, 2007 12:25 pm
by skydiablo
Code: Select all
uses RVJvGifAnimate;
type
TMainFormVCL = class(TObject)
constructor create(aDestination : TCustomForm);
destructor destroy; override;
private
fDestination : TCustomForm;
...
fRichView : TRichView;
..
procedure BuildForm;
procedure KillForm;
...
public
property Destination : TCustomForm read fDestination write fDestination;
property RichView : TRichView read fRichView write fRichView;
...
end;
...
constructor TMainFormVCL.create(aDestination : TCustomForm);
begin
fDestination := aDestination;
BuildForm;
...
end;
destructor TMainFormVCL.destroy;
begin
KillForm;
end;
procedure TMainFormVCL.BuildForm;
const DefaultBorderBorder : integer = 10;
begin
...
fPanel8 := TPanel.Create(self.fDestination);
fPanel8.Parent := self.fDestination;
...
fPanel7 := TPanel.Create(fPanel8);
fPanel7.Parent := fPanel8;
...
fRichView := TRichView.Create(fPanel7);
fRichView.Parent := fPanel7;
fRichView.Left := DefaultBorderBorder;
fRichView.Top := DefaultBorderBorder;
fRichView.Width := fPanel7.Width - DefaultBorderBorder;
fRichView.Height := fPanel7.Height - fRichView.Top - DefaultBorderBorder;
fRichView.Anchors := [akLeft,akTop,akRight,akBottom];
fRichView.BottomMargin := 5;
fRichView.AnimationMode := rvaniOnFormat;
...
end;
...
...
...
uses RVJvGifAnimate;
procedure TForm1.FormCreate(Sender: TObject);
begin
MainFormVCL := TMainFormVCL.create(self);
...
it must be...
sky...
Posted: Fri Mar 09, 2007 3:17 pm
by shmp
TjvGifAnimate (used by RVGifAnimate) and TJvGifImage are two different things. TjvGifAnimate will animate the GIF in TjvGifImage but TjvGifImage will not work alone. Most probably you have not include the jvGifImage in the use section.
Hope this helps.
Posted: Sat Mar 10, 2007 6:28 pm
by Sergey Tkachenko
RichView does not use JVCL gif animation class (TJvGIFAnimator), it animates gifs itself. If you include RvJvGifAnimate unit, you include JvGif unit automatically, because RvJvGifAnimate uses JvGif.
I cannot tell what's wrong by this example. Please send me a simple project that I can compile.
Posted: Tue Mar 13, 2007 1:49 am
by skydiablo
hi...
here is a very simple sample with the same problem !
DOWNLOAD
like this i use it now... and no gif animation ?
thx for help !!!
greez, sky...
Posted: Tue Mar 13, 2007 4:44 pm
by Sergey Tkachenko
FormatTail does not start animation.
Call rv.Format after you create TRichView (the last line in TRVExtraUnit.create).
(
one more note:
FormatTail does not format document properly, if items are added to the same paragraph after the last call of Format/FormatTail. So you cannot start Trvaddsmilie.add from adestination.Add. You must start from AddNL with ParaNo parameter >= 0.
Besides, -1 is not a valid value for StyleNo parameter. TRichView replaces it with rvsDefStyle (meaning using default text style for paragraph, 0 by default).
So change adestination.Add('TEST: ',-1) to adestination.AddNL('TEST: ',0,0).
)