Page 1 of 1
COPY AND INSERT
Posted: Sat Apr 01, 2006 11:21 am
by OldHawk
1, in my RichViewEdit, i selected some text and gif(TGIFImage), and press CTRL+C, CTRL+P,bug only paste the text ,has not gif? is anywhere set wrong? i can copy form Demo Application.
2,in my RichViewEdit, i set caret pos at middle of some words,then insert one gif, how to get the latest inserted ItemNo(gif)? maby has many gif in RichViewEdit.
i used RichView a few days, so mush content, search some qustion is so slow.very thans.
Posted: Sat Apr 01, 2006 11:33 am
by OldHawk
why? i insert some gif to middle of richviewedit,the caret is not at after the inserted gif. but caret is at after the inserted gif in DemoEditor.
Posted: Sat Apr 01, 2006 11:42 am
by Sergey Tkachenko
1. Call RegisterClass(TGifImage) one time, when the application starts.
2. How do you insert this gif? Do you insert only one picture using InsertPicture method, then you can get it using GetCurrentPictureInfo.
Posted: Sat Apr 01, 2006 11:59 am
by OldHawk
i already register class in formMain.Create method:
RegisterClass(TGifImage);
CTRL+C,CTRL+P however has no image.
i maby already insert few gif in it, then i set caret to middle of them with mouse, and insert new gif, this time, the carset is not at after the latest inserted gif.
i select gif from a frame,and add to the parent form`s RichViewEdit.
Code: Select all
var gif: TGIFImage;
----
gif:=TGIFImage.Create;
gif.Assign(gr);
TformMsg(fmMsg).RichViewEditSend.InsertPicture(s,gif,rvvaBaseLine);
TformMsg(fmMsg).RichViewEditSend.Format;
hide;
TformMsg(fmMsg).RichViewEditSend.SetFocus;
-----
Posted: Sat Apr 01, 2006 12:11 pm
by OldHawk
i can copy bitmap(not gif) from Demo Editor , and paste to my RichViewEdit,
but can not copy bitmap from my RichViewEdit and paste to Demo Editor.
Posted: Sat Apr 01, 2006 12:20 pm
by Sergey Tkachenko
Remove call of Format - it's not needed after Insert*** methods, and it moves caret to the beginning.
May be you copy gifs to demo editor? It was compiled without gif support.
Posted: Sat Apr 01, 2006 12:29 pm
by OldHawk
1,only addpicture** need Format?
2, no, because copy gif in my application is failed, so i test copy bitmap between my application and Demo application. copy bitmap also failed.
Posted: Sat Apr 01, 2006 12:37 pm
by Sergey Tkachenko
All Add*** methods need format. They should be used for document generation: rv.Clear, then calling one or more Add*** methods, then call rv.Format.
Generally, all methods for document modification introduced in TRichView need calling Format (they are marked in the help file as "viewer-style methods", all method introduced in TRichViewEdit reformat document automatically (they are marked in the help file as "editing-style methods").
See "Viewer vs Editor" help topic for details.
As for copy-pasting Gifs, see my answer before.
I do not know why bitmaps are not loaded. You can save this document in RVF file and send to me, I'll try to see what's wrong.
Posted: Sun Apr 02, 2006 6:26 am
by OldHawk
1, because i set rvoAutoCopyRVF to false,os i can`t copy bitmap from rv,i turn it true, is OK,can copy bitmap now.
2, i reRegister TGIFImage Class at Here
Code: Select all
begin
Application.Initialize;
RegisterClass(TGifImage);
Application.CreateForm(TformMain, formMain);
Application.Run;
end.
now can copy gif from one rv to other rv normal. but when i copy some text and gif together , or copy more than one gif, is same , the application is stop respond, CPU used 99% with my application,why? if i copy only one gif , it can work normal
Posted: Sun Apr 02, 2006 9:16 am
by Sergey Tkachenko
What is your version of Delphi?
Did you download update of TGifImage?
Posted: Sun Apr 02, 2006 9:58 am
by OldHawk
bds 2006
where can download new TGifImage??
Posted: Sun Apr 02, 2006 8:20 pm
by Sergey Tkachenko