Issue Exporting Chart To Graphics

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
MarkR
Newbie
Newbie
Posts: 5
Joined: Thu May 21, 2009 12:00 am

Issue Exporting Chart To Graphics

Post by MarkR » Wed Mar 31, 2010 2:18 am

Hello,

I am having an issue exporting a chart to a graphics file. Everything works as expected when the chart is on a form by itself, but when the chart is included in a tab control the chart panel always comes out black. I have a project to demonstrate, but it is too big to post; I would be happy to send via email.

Mark

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

Re: Issue Exporting Chart To Graphics

Post by Sandra » Wed Mar 31, 2010 12:28 pm

Hello Mark,
I have a project to demonstrate, but it is too big to post; I would be happy to send via email.
It doesn't necessary to add folders bin and obj. Please remove folders and try again to upload your project. If you doesn't achieve to attach project in the thread, you could add it to upload page.

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

MarkR
Newbie
Newbie
Posts: 5
Joined: Thu May 21, 2009 12:00 am

Re: Issue Exporting Chart To Graphics

Post by MarkR » Wed Mar 31, 2010 2:09 pm

Hello,

Thank you, attached is the project.

Mark
Attachments
TChartExport.zip
Example Project Workspace
(17.58 KiB) Downloaded 352 times

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

Re: Issue Exporting Chart To Graphics

Post by Sandra » Thu Apr 01, 2010 10:00 am

Hello MarkR,

I have found where the problem is. I you needs put Transparency=0. Please, change code of export button for next, and check if works as you want.

Code: Select all

 private void button1_Click(object sender, EventArgs e)
        {
            string strMoeGraphFilename = "TChartExport";
            this.tChart1.Focus();
            this.tChart1.BackColor = Color.White;
            this.tChart1.Panel.Color = Color.White;
            this.tChart1.Walls.Back.Color = Color.White;
            this.tChart1.Panel.Transparency=0;

            strMoeGraphFilename += ".bmp";
            this.tChart1.Export.Image.Bitmap.ColorReduction = Steema.TeeChart.Export.BitmapFormat.BMPColorReduction.Default;
            this.tChart1.Export.Image.Bitmap.Save(Application.StartupPath + "\\" + strMoeGraphFilename);

            this.tChart1.BackColor = Color.Transparent;
            this.tChart1.Panel.Visible = false;
            this.tChart1.Walls.Back.Color = Color.Black;
            this.tChart1.Walls.Back.Transparent = false;
            this.tChart1.Walls.Back.Brush.Gradient.Visible = false;
        }
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

MarkR
Newbie
Newbie
Posts: 5
Joined: Thu May 21, 2009 12:00 am

Re: Issue Exporting Chart To Graphics

Post by MarkR » Thu Apr 01, 2010 12:31 pm

Sandra,

Thank you. You might have noticed that in my original code that I submitted I had this line commented out, I was trying to see if this would resolve the issue. Additionally, I had "this.tChart1.Panel.Transparent = false;" set in the constructor. Now the interesting part, when I set the "this.tChart1.Panel.Transparency = 0;" on my main development machine I get the background color to show correctly in the saved graphic file, but on my other office machine the panel still shows as black.

I will contine to look into this issue on my side to see if there is more information that I could provide to you to help decipher this issue. I am wondering if there is some rendering issues related to specific video cards?

Thanks,
Mark

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Issue Exporting Chart To Graphics

Post by Narcís » Thu Apr 01, 2010 1:15 pm

Hi Mark,
I am wondering if there is some rendering issues related to specific video cards?
Not that we are aware of.
Best Regards,
Narcís Calvet / 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