RVPrint support background image in Header ?
Posted: Sat Jul 26, 2008 5:42 pm
[ Using TRichViewEdit v10.2 ]
RVPrint does not support header background image?
I am assigning a background image to a RichView and then assigning this to RVPrint using SetHeader method. But the preview does not show the background image. Is this not supported?
I need to impose text on top of a image (in the header) so I really need background image.
My code:
Building the header richview:
Previewing :
Regards,
ND
RVPrint does not support header background image?
I am assigning a background image to a RichView and then assigning this to RVPrint using SetHeader method. But the preview does not show the background image. Is this not supported?
I need to impose text on top of a image (in the header) so I really need background image.
My code:
Building the header richview:
Code: Select all
var
x : integer;
p : TJpegImage;
begin
// clear header, content
rV1.Clear;
rVHdr1.Clear;
// header - image
p := TJpegImage.Create;
p.LoadFromFile(TEMPLATESPATH + cmbMainPresetHeader.Text);
rVHdr1.BackgroundStyle := bsStretched;
rVHdr1.BackgroundBitmap := TBitmap(p) ;
rVHdr1.Invalidate;
// header - text
with rvStyleHdr.TextStyles.Add do
begin
FontName := strToFont(setupInfo.textFont.FontName, defaultFont).Name ;
Size := strToFont(setupInfo.textFont.FontName, defaultFont).Size;
Color := strToFont(setupInfo.textFont.FontName, defaultFont).Color;
Style := strToStyle(setupInfo.textFont.FontStyle) ;
StyleName := 'HEADER';
end;
x:=rvStyleHdr.TextStyles.Count-1;
with rVHdr1 do
begin
AddNL( txtHeaderLine1.Text, x, -1);
AddNL( txtHeaderLine2.Text, x, 0 );
AddNL( txtHeaderLine3.Text, x, 0 );
Format;
end;
Code: Select all
setReportText;
rvPrint.SetHeader(rvHdr1.RVData);
rvPrint.AssignSource(rV1);
rvPrint.FormatPages(rvdoALL);
RVPrintPreview1.UpdateView;
ND