Metafile height is always 65535

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
buchi
Newbie
Newbie
Posts: 14
Joined: Thu Jan 05, 2006 12:00 am

Metafile height is always 65535

Post by buchi » Tue Oct 05, 2010 2:56 pm

Hi

When I use the Metafile property of TChart I always get an image height of 65535 - regardless of the actual TChart size.
Any idea what could cause that?

The TeeChart version used is 2.0.2987.19069

Thank you for your help!

Best regards,
Manuel

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Metafile height is always 65535

Post by Sandra » Wed Oct 06, 2010 8:20 am

Hello Manuel,

I couldn't reproduce your problem using last version 2 and next code:

Code: Select all

     public Form1()
        {
            InitializeComponent();
            InitializeChart();
        }
        Steema.TeeChart.Styles.Line series1;
        private void InitializeChart()
        {
            series1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
            series1.FillSampleValues();

            tChart1.Refresh();

            tChart1.Export.Image.Metafile.EMFFormat = System.Drawing.Imaging.EmfType.EmfOnly;
            tChart1.Export.Image.Metafile.Save("c:\\teeChartEmfOnly.emf");


            tChart1.Export.Image.Metafile.EMFFormat = System.Drawing.Imaging.EmfType.EmfPlusDual;
            tChart1.Export.Image.Metafile.Save("c:\\teeChartEmfPlusDual.emf");

            tChart1.Export.Image.Metafile.EMFFormat = System.Drawing.Imaging.EmfType.EmfPlusOnly;
            tChart1.Export.Image.Metafile.Save("c:\\teeChartEmfPlusOnly.emf"); 
         }
Could you please, check if previous code works fine for you?

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

buchi
Newbie
Newbie
Posts: 14
Joined: Thu Jan 05, 2006 12:00 am

Re: Metafile height is always 65535

Post by buchi » Wed Oct 06, 2010 8:38 am

Hi Sandra

It seems, that the problem only occurs when a series contains values which would appear outside the chart's bounds. For example, if you add double.PositiveInfinite and double.NegativeInfinite values to an area series while setting the y-axis scale to 0...1 you should encounter the same issue.

Best regards,
Manuel

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Metafile height is always 65535

Post by Sandra » Wed Oct 06, 2010 11:09 am

Hello Manuel,

I could not reproduce it here with last version 2 of TeeChart.Net. Could you please, send us a simple example, because we can reproduce your problem exactly here?

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

buchi
Newbie
Newbie
Posts: 14
Joined: Thu Jan 05, 2006 12:00 am

Re: Metafile height is always 65535

Post by buchi » Thu Oct 07, 2010 5:33 am

Hi Sandra
Please find attached a small project which demonstrates the issue.
Have fun! :D
Manuel
Attachments
TeeChartDemo.zip
(15.2 KiB) Downloaded 313 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Metafile height is always 65535

Post by Sandra » Thu Oct 07, 2010 9:43 am

Hello Manuel,

Thanks for your project. I can reproduce your problem with height in last version 2 but not in last version 4. I strongly recommend you to download the fully functional evaluation version available at http://www.steema.com/evaluation/net and check again if problem persist. Moreover, I suggest a workaround using BITMAP image that seems works correctly for version 2:

Code: Select all

public Form1()
        {
            InitializeComponent();
            InitializeChart();
            Debug.Assert(tChart1.Size.Equals(tChart1.Metafile.Size), "Size of the metafile is not equal to the chart size");
        }      
        private void InitializeChart()
        {
            bool bgEnabled = false;
            for (int i = 0; i < 4; i++)
            {
                TimeSpan t = new TimeSpan(0, 0, i);
                tChart1[0].Add(t.TotalDays, bgEnabled ? double.PositiveInfinity : double.NegativeInfinity);
                tChart1[1].Add(t.TotalDays, Math.Sin(i));
                bgEnabled = !bgEnabled;
            }
        }
I hope will helps.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply