Hello All,
When generating TChart metafile and save it. The image has the black border.
((TaoPlotView)this.Controls).tChart.Metafile.Save(stream,ImageFormat.Jpeg);
So Thanks,
Renata
When generating TChart.Metafile and it has black border
-
- Newbie
- Posts: 7
- Joined: Wed Oct 19, 2005 4:00 am
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Renata,
It works fine for me here using the code below. Can you please test if this works for you? Otherwise, could you please send us an example we can run "as-is" to reproduce the problem here? You can post your files at [url]news://www.steema.net/steema.public.attachments[/url] newsgroup.
BTW: Don't forget to mention which TeeChart version you are using.
It works fine for me here using the code below. Can you please test if this works for you? Otherwise, could you please send us an example we can run "as-is" to reproduce the problem here? You can post your files at [url]news://www.steema.net/steema.public.attachments[/url] newsgroup.
BTW: Don't forget to mention which TeeChart version you are using.
Code: Select all
tChart1.Export.Image.Metafile.Save(@"c:\temp\metafilebug.emf");
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 |
-
- Newbie
- Posts: 7
- Joined: Wed Oct 19, 2005 4:00 am
When generating TChart.Metafile and it has black border
Hello Narcís Calvet,
Thanks for your help.
I sent a email for support with the atachment that you asked me.
My TeeChart version is 2.
Thanks,
Renata
Thanks for your help.
I sent a email for support with the atachment that you asked me.
My TeeChart version is 2.
Thanks,
Renata
-
- Newbie
- Posts: 7
- Joined: Wed Oct 19, 2005 4:00 am
When generating TChart.Metafile and it has black border
Hello Narcís Calvet,
The email that I sent you returned.
The steps below will generate the tchart with the black border:
1 - I created the form;
2 - I put a panel in form;
3- I put the TeeChart in panel and dock it;
4 - In form load I put this code:
private void Form1_Load(object sender, System.EventArgs e) {
tChart1.Header.Visible = true;
tChart1.Header.Text = "Test";
Steema.TeeChart.Styles.Line line = new Steema.TeeChart.Styles.Line();
line.FillSampleValues(10);
tChart1.Series.Add(line);
}
5 - Click button event I saved the TeeChart
private void button1_Click(object sender, System.EventArgs e) {
MemoryStream stream = new MemoryStream();
tChart1.Metafile.Save(stream,ImageFormat.Jpeg);
Image image = Image.FromStream(stream);
image.Save(@"C:\teste1.bmp",ImageFormat.Jpeg);
}
So Thanks,
Renata
The email that I sent you returned.
The steps below will generate the tchart with the black border:
1 - I created the form;
2 - I put a panel in form;
3- I put the TeeChart in panel and dock it;
4 - In form load I put this code:
private void Form1_Load(object sender, System.EventArgs e) {
tChart1.Header.Visible = true;
tChart1.Header.Text = "Test";
Steema.TeeChart.Styles.Line line = new Steema.TeeChart.Styles.Line();
line.FillSampleValues(10);
tChart1.Series.Add(line);
}
5 - Click button event I saved the TeeChart
private void button1_Click(object sender, System.EventArgs e) {
MemoryStream stream = new MemoryStream();
tChart1.Metafile.Save(stream,ImageFormat.Jpeg);
Image image = Image.FromStream(stream);
image.Save(@"C:\teste1.bmp",ImageFormat.Jpeg);
}
So Thanks,
Renata
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Renata,
I could reproduce what you reported using your code. However, the appropiate way of doing that and what works fine is using:
I could reproduce what you reported using your code. However, the appropiate way of doing that and what works fine is using:
Code: Select all
private void button1_Click_1(object sender, System.EventArgs e)
{
tChart1.Export.Image.JPEG.Save(@"C:\teste1.jpg");
}
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 |
-
- Newbie
- Posts: 7
- Joined: Wed Oct 19, 2005 4:00 am
Print metafile image
Hi Narcís Calvet,
Thanks, but I need metafile image, because the quality is better.
Do you have any idea how I can print metafile image?
So Thanks,
Renata
Thanks, but I need metafile image, because the quality is better.
Do you have any idea how I can print metafile image?
So Thanks,
Renata
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Renata,
Then you can use:
.
However if you want to print the chart you can do it directly with TeeChart routines as it internally uses a metafile as explained here so you could do:
Then you can use:
Code: Select all
tChart1.Export.Image.Metafile.Save(@"C:\temp\teste1.emf");
However if you want to print the chart you can do it directly with TeeChart routines as it internally uses a metafile as explained here so you could do:
Code: Select all
private void button1_Click(object sender, System.EventArgs e)
{
tChart1.Printer.Preview();
}
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 |