I am creating a bitmap from a TChart at run time to print in a report. (One series in the chart has Transparent set to True, which means I can not use the WMF format as this is not supported).
I use the following code:
lBmp.Width := lRect.Right;
lBmp.Height := lRect.Bottom;
lChart.Draw(lBmp.Canvas, lRect);
Problem is that the bitmap shows up pixelated--is there any way to improve the quality of the printed image? (I looked at th properties of the TBitmap, which would seem the natural place, but could not find it). I know I could increaste the values of .Right and .Bottom (e.g. double the values) but then the fonts are too small.
Any suggestions?
Pixelated Bitmap
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Ed,
One way to enhance the quality of the bitmap to be printed would be increasing its size.
One way to enhance the quality of the bitmap to be printed would be increasing its size.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Hi Ed,
I'm afraid the easiest way is (as you said) to increase the Font size depending on the image size, not using the Font.Size property, but the FontZoom, i.e :
I'm afraid the easiest way is (as you said) to increase the Font size depending on the image size, not using the Font.Size property, but the FontZoom, i.e :
Code: Select all
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
if SaveDialog1.Execute then { <-- ask for a filename first }
begin
{ SAVE IT !! }
Chart1.Width := Chart1.Width + Chart1.Width;
Chart1.Height := chart1.Height + chart1.Height;
Chart1.Aspect.FontZoom := 140;
{ CLIPPING WORKS FINE BUT DO NOT ALLOW MOVEABLE OR RESIZEABLE METAFILES }
{ TO FORCE CLIPPING WITH METAFILES UNCOMMENT THIS LINE: }
{ TeeClipWhenMetafiling:=True; }
Chart1.SaveToMetafile(SaveDialog1.FileName);
{ THIS METHOD CAN BE USED TOO: }
(*
Chart1.SaveToMetafileRect( SaveDialog1.FileName,
Rect( 0,0, round(21{cm}*37.8), round(10{cm}*37.8)));
*)
{ ( this equals to 96 * 21 / 2.54 , 96 * 10 /2.54 ) }
{ now it's loaded HERE ! }
Image1.Picture.LoadFromFile(SaveDialog1.FileName);
Image1.Refresh;
Chart1.Width := Chart1.Width - Chart1.Width;
Chart1.Height := chart1.Height - chart1.Height;
Chart1.Aspect.FontZoom := 100;
end;
end;
Pep Jorge
http://support.steema.com
http://support.steema.com