begin
TheRichView.Clear;
for i:=1 to pp do
begin
gr := TMetafile.Create;
pic.Picture.LoadFromFile('C:\Temp\'+WFilePrefix+Format('%4.4d',[i])+'.WMF');
pic.Width:=ThePreview.AreaWidth;
gr.Assign(pic.Picture);
TheRichView.AddPictureEx('',gr,0,rvvaBaseline);
TheRichView.AddBreak;
end;
end;
I want to reformat them to be correctly viewed (and printed) into a TRVPrintPreview (linked to a RVPrint) control. I've attempted several ways to do this but without success.The metafiles are always too much big in width (they are clipped on the right).
Pratically, I want resize every metafile to fit into the preview area (one for each page and considering preview margins) and then print them to a printer. For the preview I've not found any property like PageWidth so I don't know how to fit the files into the previewer. I've modified the previous source with the following:
TheRichView.Clear;
for i:=1 to pp do
begin
gr := TMetafile.Create;
pic.Picture.LoadFromFile('C:\Temp\'+WFilePrefix+Format('%4.4d',[i])+'.WMF');
gr.Assign(pic.Picture);
TheRichView.AddPictureEx('',gr,0,rvvaBaseline);
TheRichView.SetItemExtraIntProperty(TheRichView.ItemCount-1,
rvepImageWidth,
ThePreview.AreaWidth);
therichview.PageBreaksBeforeItems[TheRichView.ItemCount-1]:=TRUE;
end;
... but in the SetItemExtraIntProperty call I don't know what is the AreaWidth property of the previewer(I've made an attempt...). With this param the metafile width is too small (3/4 of the previewer area).