Copy table to image?

General TRichView support forum. Please post your questions here
Post Reply
show00
Posts: 11
Joined: Sun Aug 10, 2014 1:13 pm

Copy table to image?

Post by show00 »

i want to copy one table to image and save it
how can i do it
thanks
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

You need to copy the table to TRVReportHelper and draw its content as an image.

Let the Table is in RichView1.
Assign
RVReportHelper1.Style := RichView1.Style;
Copy:

Code: Select all

var TableCopy:TRVTableItemInfo;
  Stream: TMemoryStream;
TableCopy := TRVTableItemInfo.CreateEx(1,1, RVReportHelper1.RichView.RVData);
Stream := TMemoryStream.Create;
Table.SaveToStream(Stream);
Stream.Position := 0;
TableCopy.LoadFromStream(Stream);
Stream.Free;
RVReportHelper1.RichView.Clear;
RVReportHelper1.RichView.AddItem('', TableCopy);
Then create an image from RVReportHelper1. See the demo in Demos\DelphiUnicode\Assorted\Graphics\ToImage.
Post Reply