richview to any type image

General TRichView support forum. Please post your questions here
Post Reply
adamrich
Posts: 35
Joined: Sun Feb 19, 2006 1:55 pm

richview to any type image

Post by adamrich »

Hello,

Is it possible to save/ or export richview to image ?

Thanks
adamrich
Posts: 35
Joined: Sun Feb 19, 2006 1:55 pm

Post 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
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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)
Post Reply