Hi,
it is possible to export the current TeeChart as a JPEG file (for TeeChart.Pocket)?
We want to display the current Chart in a WebPage!
The bitmap function have i found...
TeeChart for Compact Framework: JPEG export
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi VESCON,
Exporting is not currently available with TeeChart.Pocket.dll. It is already on our wish-list to be considered for inclusion in future releases.
Exporting is not currently available with TeeChart.Pocket.dll. It is already on our wish-list to be considered for inclusion in future releases.
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 |
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hello,
TeeChart uses the Bitmap property/function internally to export a JPEG file. If you use the Chart property of the pocket TChart then you should be able to do something similar, e.g. (untested):
TeeChart uses the Bitmap property/function internally to export a JPEG file. If you use the Chart property of the pocket TChart then you should be able to do something similar, e.g. (untested):
Code: Select all
public void Save(Stream stream)
{
if (Width<=0) Width=400;
if (Height<=0) Height=300;
Bitmap b=chart.Bitmap(Width,Height);
GetImageOptions(ref b);
b.Save(stream,Encoder,EncoderParams);
stream.Flush();
b.Dispose();
}
public void GetImageOptions(ref Bitmap b)
{
if (GrayScale) ConvertToGrayscale(ref b);
}
public ImageFormat GetFormat()
{
return System.Drawing.Imaging.ImageFormat.Jpeg;
}
public ImageFormat Format
{
get { return GetFormat(); }
}
public ImageCodecInfo Encoder
{
get { return GetEncoderInfo(Format.Guid); }
}
public ImageCodecInfo GetEncoderInfo(Guid g)
{
ImageCodecInfo[] encoders=ImageCodecInfo.GetImageEncoders();
for (int t=0; t<encoders.Length; t++)
{
if(encoders[t].FormatID==g)
return encoders[t];
}
return null;
}
public EncoderParameters EncoderParams
{
get
{
EncoderParameters result=new EncoderParameters(1);
result.Param[0]=new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, Quality);
return result;
}
}
public int Quality
{
get { return quality; }
set { quality=value; }
}
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/
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi VESCON,
That's the reason why this can't be done .
That's the reason why this can't be done .
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 |