I need to be able to take the chart into a reporting control, but unfortunately the only way to do this is through a bitmap, or a metafile.
Using the TChart.Metafile thing sorta works, but it doesn't seem to have any adjustable settings (Makes sense, since it's the screen representation of the chart).
What I would need is a "Resolution" property like in the Printer attribute. Is that available?
I've also tried the Export.Image.TIFF options, but when it prints, it doesn't look quite right. How would I determine the proper settings between the "Printer" and the "Export" attributes so that they look the same?
Thanks!
Any way to "Print" to a metafile, etc?
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi --
How about using the .NET Bitmap Class, e.g.need to be able to take the chart into a reporting control, but unfortunately the only way to do this is through a bitmap, or a metafile.
Using the TChart.Metafile thing sorta works, but it doesn't seem to have any adjustable settings (Makes sense, since it's the screen representation of the chart).
What I would need is a "Resolution" property like in the Printer attribute. Is that available?
Code: Select all
Bitmap b = tChart1.Bitmap;
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Hi,
I've tried here and changing de resolucion I've noted that the Title and also the grid lines are not printed. Are you referencing to this ?I've also tried the Export.Image.TIFF options, but when it prints, it doesn't look quite right. How would I determine the proper settings between the "Printer" and the "Export" attributes so that they look the same?
Pep Jorge
http://support.steema.com
http://support.steema.com
The metafile should print out alot cleaner (since it's vector based) as opposed to a bitmap.
The only way that I can sort make the image look the same as the printed version is to mess around with the size of the chart control. Even still, they don't look quite correct.
Essentially, I need a function like:
tChart1.Printer.Resolution = 50;
tChart1.Printer.Export.Metafile.Height = 1024;
tChart1.Printer.Export.Metafile.Width = 768;
Image finalImage = tChart1.Printer.Export.Metafile.SaveImage();
The following samples show how they all output different images (ie. fonts are larger/smaller in relation to the rest of the chart, etc):
//First Image
tChart1.Printer.Resolution = 50;
tChart1.Printer.Landscape = True;
tChart1.Printer.UseAntiAlias = True;
tChart1.Printer.Print();
//Second Image
tChart1.Width = 1024;
tChart1.Height = 768;
Image myImage2 = tChart1.Metafile;
//Third Image
tChart1.Width = 800;
tChart1.Height = 600;
Image myImage3 = tChart1.Metafile;
//Fourth Image
tChart1.Export.Image.TIFF.Width = 1024;
tChart1.Export.Image.TIFF.Height = 768;
tChart1.Export.Image.TIFF.CopyToClipboard();
IDataObject clip = Clipboard.GetDataObject();
Image myImage4 = CType(clip.GetData(GetType(Bitmap)), Image);
The only way that I can sort make the image look the same as the printed version is to mess around with the size of the chart control. Even still, they don't look quite correct.
Essentially, I need a function like:
tChart1.Printer.Resolution = 50;
tChart1.Printer.Export.Metafile.Height = 1024;
tChart1.Printer.Export.Metafile.Width = 768;
Image finalImage = tChart1.Printer.Export.Metafile.SaveImage();
The following samples show how they all output different images (ie. fonts are larger/smaller in relation to the rest of the chart, etc):
//First Image
tChart1.Printer.Resolution = 50;
tChart1.Printer.Landscape = True;
tChart1.Printer.UseAntiAlias = True;
tChart1.Printer.Print();
//Second Image
tChart1.Width = 1024;
tChart1.Height = 768;
Image myImage2 = tChart1.Metafile;
//Third Image
tChart1.Width = 800;
tChart1.Height = 600;
Image myImage3 = tChart1.Metafile;
//Fourth Image
tChart1.Export.Image.TIFF.Width = 1024;
tChart1.Export.Image.TIFF.Height = 768;
tChart1.Export.Image.TIFF.CopyToClipboard();
IDataObject clip = Clipboard.GetDataObject();
Image myImage4 = CType(clip.GetData(GetType(Bitmap)), Image);