Page 1 of 1

Copy table to image?

Posted: Sat Aug 16, 2014 1:18 pm
by show00
i want to copy one table to image and save it
how can i do it
thanks

Posted: Wed Aug 20, 2014 5:44 am
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.