I am having trouble altering the dimensions of the metafile when exporting a chart to it.
No matter what values I enter for Width and Height the dimensions of the file are exactly the same. ie. 387X284
What am I doing wrong here?
gphPie.Export.Image.Metafile.bEnhanced = True
gphPie.Export.Image.Metafile.Width = 500
gphPie.Export.Image.Metafile.Height = 300
gphPie.Export.Image.Metafile.Save(FileName)
I tried changing the size of the chart on the window form but to no avail.
Is this a known bug or am I missing something?
Thanks.
BTW The chart I am exporting is a pie chart and using version 2.0.2306.26231.
Chart Metafile Export
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi GregSki,
It works fine for me here using the latest debug build available at the customer area and using this code:
Can you please test if it works at your end?
It works fine for me here using the latest debug build available at the customer area and using this code:
Code: Select all
Steema.TeeChart.Export.MetafileFormat metaFile = tChart1.Export.Image.Metafile;
metaFile.Height = 300;
metaFile.Width = 500;
metaFile.bEnhanced = true;
metaFile.Save(FileName);
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: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi GregSki,
Could you please send us an example we can run "as-is" to reproduce the problem here? You can post your files at news://www.steema.net/steema.public.attachments newsgroup.
Thanks in advance.
Could you please send us an example we can run "as-is" to reproduce the problem here? You can post your files at news://www.steema.net/steema.public.attachments newsgroup.
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi GregSki,
Thank you very much for the project.
I could fine what the problem is. This only happens when you set CustomXRadius and CustomYRadius for the pie series. I've added the defect (TF02011722) to our bug list to be fixed for future releases.
In the meantime, a workaround is setting those properties to automatic (zero) before exporting to metafile and setting them back to the original value:
Thank you very much for the project.
I could fine what the problem is. This only happens when you set CustomXRadius and CustomYRadius for the pie series. I've added the defect (TF02011722) to our bug list to be fixed for future releases.
In the meantime, a workaround is setting those properties to automatic (zero) before exporting to metafile and setting them back to the original value:
Code: Select all
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
gphPie.Header.Text = "Title"
gphPie.Series(0).Clear()
gphPie.Series(0).Add(1000, "Rental (" & Format(0.8, "#0.0%") & ")", Color.FromArgb(38, 81, 222))
gphPie.Series(0).Add(100, "Tax Savings (" & Format(0.1, "#0.0%") & ")", Color.FromArgb(111, 137, 222))
gphPie.Series(0).Add(100, "Contribution (" & Format(0.1, "#0.0%") & ")", Color.FromArgb(212, 219, 255))
gphPie.Refresh()
'Workaround Section 1
Dim tmpX As Integer = Me.Pie1.CustomXRadius
Dim tmpY As Integer = Me.Pie1.CustomYRadius
Me.Pie1.CustomXRadius = 0
Me.Pie1.CustomYRadius = 0
'End Workaround Section 1
Dim metaFile As Steema.TeeChart.Export.MetafileFormat
metaFile = gphPie.Export.Image.Metafile
metaFile.Width = 50
metaFile.Height = 30
metaFile.bEnhanced = True
metaFile.Save(Application.StartupPath & "\test.emf")
'Workaround Section 2
Me.Pie1.CustomXRadius = tmpX
Me.Pie1.CustomYRadius = tmpY
'End Workaround Section 2
End Sub
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 |