Tee Chart as Thumb Nail
Tee Chart as Thumb Nail
Hi,
I want to display the Tee Chart which I am already exporting as PNG Image as Thumb Nail version. Can some one tell me how can I do so?
Thanks,
Areef
I want to display the Tee Chart which I am already exporting as PNG Image as Thumb Nail version. Can some one tell me how can I do so?
Thanks,
Areef
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Areef,
When exporting a chart to an image you can specify the size of the image you want to generate, for example:
When exporting a chart to an image you can specify the size of the image you want to generate, for example:
Code: Select all
TChart1.Export.asPNG.Height = 20
TChart1.Export.asPNG.Width = 50
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 Narcís,
It does NOT help me. My Tee Chart is best viewed at 720*360 (Width*Hieght) size. Now, I want the same Image to be available in smaller size of say 50*20. if I change the Width and Height as suggested by you here, the Image is LOST and only some portion of the Image is shown.
Thanks and Regards,
Areef
It does NOT help me. My Tee Chart is best viewed at 720*360 (Width*Hieght) size. Now, I want the same Image to be available in smaller size of say 50*20. if I change the Width and Height as suggested by you here, the Image is LOST and only some portion of the Image is shown.
Thanks and Regards,
Areef
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Areef,
Then you could save the chart's size in temporary variables, resize it to 50*20, export the chart and resize the chart again to the original dimensions.
Then you could save the chart's size in temporary variables, resize it to 50*20, export the chart and resize the chart again to the original dimensions.
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 |
I think I did't get exactly what you wanted me to do.
My code is as follows.
I want this same code to be running in 2 modes, one mode while exporting as Full Image and another mode to export as Thumb Nail basically a smaller view of the same Image.
Could you help me in re-arranging the code so that I achieve my task?
Thanks again and Regards,
Areef
My code is as follows.
Code: Select all
tchart.Export.asPNG.Width = 720;
tchart.Export.asPNG.Height = 360;
return ((byte[]) tchart.Export.asPNG.SaveToStream());
Could you help me in re-arranging the code so that I achieve my task?
Thanks again and Regards,
Areef
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Areef,
My suggestion was something like this:
My suggestion was something like this:
Code: Select all
Dim tmpW, tmpH As Integer
tmpW = TChart1.Width
tmpH = TChart1.Height
'Export chart
TChart1.Export.asPNG.SaveToFile FileName
'Export thumbnail
TChart1.Width = 50
TChart1.Height = 20
TChart1.Export.asPNG.SaveToFile ThumbnailName
'Restore original chart dimensions
TChart1.Width = tmpW
TChart1.Height = tmpH
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 |
When I am exporting in one style/mode I am not worried about the other style/mode.
When I am in Full Image Modei will export as Full Image only and not worried about Thumb Nail version and similarly when I am in Thumb Nail mode, I will export as Thumb Nail only and dont bother to resize back to normail Image mode.
So, my code snippet would be like this.
If you observe here, I am not deling here with File Names at all and am exporting to stream and this stream is written to screen. I tried with this code only and when I am exporting as Thumbnail, the Image gets clipped rather than showing as a small Image.
I was wondering does the Zoom or CompressionLevel properties help me in any way?
Regards,
Areef
When I am in Full Image Modei will export as Full Image only and not worried about Thumb Nail version and similarly when I am in Thumb Nail mode, I will export as Thumb Nail only and dont bother to resize back to normail Image mode.
So, my code snippet would be like this.
Code: Select all
If (ExportAsFullImage)
{
tchart.Export.asPNG.Width = 720;
tchart.Export.asPNG.Height = 360;
return ((byte[]) tchart.Export.asPNG.SaveToStream());
}
else if (ExportAsThumbNail)
{
tchart.Export.asPNG.Width = 70;
tchart.Export.asPNG.Height = 60;
return ((byte[]) tchart.Export.asPNG.SaveToStream());
}
I was wondering does the Zoom or CompressionLevel properties help me in any way?
Regards,
Areef
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Areef,
Please notice that the code I posted actually resizes the chart, not the exported image. Could you please try if it works fine at your end?
Thanks in advance.
Please notice that the code I posted actually resizes the chart, not the exported image. Could you please try if it works fine at your end?
Thanks in advance.
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 |
I tried with the code as follows:
But, again here also the same result of clipping of the Image. is it correct what I am doing here?
Regards,
Areef
Code: Select all
tchart.Width = 70;
tchart.Height = 60;
return ((byte[]) tchart.Export.asPNG.SaveToStream());
Regards,
Areef
Hi Areef,
yes, one way to accomplish it, as you said, would be using the Zoom. You will have to change the Zoom before to do the export :
TChart1.Aspect.Zoom = 150
or assign it to 100 depending on the choosed option.
yes, one way to accomplish it, as you said, would be using the Zoom. You will have to change the Zoom before to do the export :
TChart1.Aspect.Zoom = 150
or assign it to 100 depending on the choosed option.
Pep Jorge
http://support.steema.com
http://support.steema.com