How Export rvf file to Jpeg.
Thanks.
How Export rvf file to Jpeg
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Code: Select all
procedure SavePageAsJpeg(SRV: TSRichViewEdit; PageNo: Integer; const FileName: String);
var
bmp: TBitmap;
jpg: TJPEGImage;
begin
bmp := TBitmap.Create;
try
bmp.Width := SRV.PageWidth100Pix;
bmp.Height := SRV.PageHeight100Pix;
SRV.DrawPage(PageNo, bmp.Width, bmp.Height, 0, 0, bmp.Canvas,
False, True, False, False);
jpg := TJPEGImage.Create;
try
jpg.Assign(bmp);
jpg.SaveToFile(FileName);
finally
jpg.Free;
end;
finally
bmp.Free;
end;
end;
procedure TForm3.ToolButton79Click(Sender: TObject);
var
i: Integer;
begin
for i := 1 to SRichViewEdit1.PageCount do
SavePageAsJpeg(SRichViewEdit1, i, ExtractFilePath(Application.ExeName) +
'page' + IntToStr(i) + '.jpg');
end;
I suggest using PNG instead. The code is the same, but use TPngImage instead of TJPEGImage, and 'png' extension instead of 'jpg'.