Insert Gif in text

General TRichView support forum. Please post your questions here
Post Reply
BLeeD

Insert Gif in text

Post by BLeeD »

Sorry, but I can't insert Gif animation between two words. I use RichView 1.9.8. Please help me with source
Sergey Tkachenko
Site Admin
Posts: 17291
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

To insert when generating a new document, or to insert in the caret position?
Guest

Post by Guest »

I write a chat and I need to insert animated smile

I use code

procedure InsertSmile;
var
Gif: TGifImage;
begin
Gif := TGifImage.Create;
Gif.LoadFromFile('1.gif');
RivhView1.AddPictureEx('', Gif, 0 , rvvBaseLine);
end;

Smile is inserted and animated, but it to be transferred a next line with all other text
Sergey Tkachenko
Site Admin
Posts: 17291
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Use -1 instead of 0 to add to the same line.
BLeeD

Post by BLeeD »

All the same it is impossible, when I use a code

var
Gif: TGifImage;
begin
Gif: = TGifImage. Create;
Gif. LoadFromFile (' Data \Smiles \censored.gif ');
RichView1. Add (' SomeText ', 0);
RichView1. AddPictureEx (", Gif, 1, rvvaMiddle);
RichView1. Add (' Other Text ', 1);
RichView1. Format;
end;

The following turns out

----------------------------------------------
SomeText
(smile)OtherText
----------------------------------------------

Use 1 only centers a picture
Sergey Tkachenko
Site Admin
Posts: 17291
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

No, not 1, but -1:
RichView1. AddPictureEx (", Gif, -1, rvvaMiddle);

If this value is positive, the image starts a new paragraph, and this value is an index in the collection RVStyle.ParaStyles defining the paragraph attributes.
If this value is -1, the image is added to the existing paragraph.
BLeeD

Post by BLeeD »

thanks, it really works!!!

It is really excellent support forum!!!
Post Reply