Why metods LoadRTFFromStream and SaveRTFToStream no Pictures

General TRichView support forum. Please post your questions here
Post Reply
sage12
Posts: 1
Joined: Tue Sep 11, 2018 9:55 am

Why metods LoadRTFFromStream and SaveRTFToStream no Pictures

Post by sage12 » Tue Sep 11, 2018 9:56 am

Hi.
Why save / loading of the data in / from database together with pictures through RTF does not work?
Through RVF save / loading works.

Code: Select all

procedure TRichEditFrame.LoadFromStream(Stream: TStream);
begin
  // Filling font names combobox
  cmbFont.Properties.Items.Assign(Screen.Fonts);
  Visible := False;
  RichEdit.Clear;
  if Stream.Size <> 0 then
  begin
    Stream.Seek(0, soFromBeginning);
//    RichEdit.LoadRVFFromStream(Stream); //lion
    RichEdit.LoadRTFFromStream(Stream);  // Alex
  end;
  RichEdit.Format;
  // you can delete non default styles here...
  RichEditCurTextStyleChanged(nil);
  RichEditCurParaStyleChanged(nil);
  SetParantFont;
  Visible := True;
  RichEdit.Modified := False;
end;

procedure TRichEditFrame.SaveToStream(Stream: TStream);
begin
  Stream.Size := 0;
//  RichEdit.SaveRVFToStream(Stream, False); //lion
  RichEdit.SaveRTFToStream(Stream, False); // Alex
  RichEdit.Modified := False;
end;
Thanks.

Sergey Tkachenko
Site Admin
Posts: 14077
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Why metods LoadRTFFromStream and SaveRTFToStream no Pictures

Post by Sergey Tkachenko » Tue Sep 11, 2018 11:10 am

Please send me RTF file which is loaded without pictures (send to richviewgmailcom) or attach to this forum.

PS: if you use Lazarus, TRichView cannot load metafiles from RTF, because Lazarus does not have TMetafile class.

Post Reply