Page 1 of 1
richview to any type image
Posted: Fri Nov 07, 2014 12:23 am
by adamrich
Hello,
Is it possible to save/ or export richview to image ?
Thanks
Posted: Mon Nov 10, 2014 10:06 pm
by adamrich
can anyone help with this question please ? is it hard to do or not possible ?
I tried to dump canvas to image, but I get only visible part. (kind of what I see in the screen) anything below scrollbar now showing.
Thanks
Posted: Tue Nov 11, 2014 12:08 pm
by Sergey Tkachenko
You can use TRVReportHelper to make images from TRichView documents.
An example can be found in demo projects:
Demos\DelphiUnicode\Assorted\Graphics\ToImage\
This demo shows how to create an image in TBitmap or TMetafile.
If you need to save another image format, you can create a bitmap and assign it.
For example, if you have image in bmp: TBitmap and want to save it as JPEG:
Code: Select all
var jpg: TJpegImage;
jpg := TJpegImage.Create;
try
jpg.Assign(bmp);
jpg.SaveToFile(...);
finally
jpg.Free;
end;
Similarly, you can use
- TGifImage for GIFs (Delphi includes TGifImage starting from Delphi 2007, otherwise you need thirdparty implementation)
- TPngImage for PNGs (Delphi includes TPngImage starting from Delphi 2009, otherwise you need thirdparty implementation)
- TWicImage for TIFFs (Delphi includes TWicImage starting from Delphi 2010, otherwise you need thirdparty implementation)