CopyToClipBoard

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
matthbri
Newbie
Newbie
Posts: 43
Joined: Wed Mar 22, 2006 12:00 am

CopyToClipBoard

Post by matthbri » Wed Sep 20, 2006 11:03 pm

Hi,

when using Chart.Export.Image.Bitmap.CopyToClipboard and pasting to 'Paint' application, the background is always Blue, although it is WhiteSmoke on the display.
Chart.BackColor = Color.WhiteSmoke;

To get it to be the correct color, I must set the Chart.Panel.Brush.Visible = true and set the brush up with the correct colors and some hashstyle.
Do the Copy, then set it back to false.

It is blue for bitmap or JPEG. I did not try others.

Why is this? is this fixed in the upcoming release? doesnt make sense.

thanks,

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

Post by Narcís » Thu Sep 21, 2006 8:31 am

Hi matthbri,

Copying to clipboard or exporting to JPEG and Bitmap works fine for me here using latest debug build available at the client area, a chart with default settings and this code:

Code: Select all

      tChart1.BackColor = Color.WhiteSmoke;
      tChart1.Export.Image.JPEG.Save(@"e:\temp\backcolor.jpg");
      tChart1.Export.Image.Bitmap.Save(@"e:\temp\backcolor.bmp");
We expect to have a new maintenance release ready in the upcoming days. Which TeeChart version are you using?
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

matthbri
Newbie
Newbie
Posts: 43
Joined: Wed Mar 22, 2006 12:00 am

Post by matthbri » Thu Sep 21, 2006 2:59 pm

I am using 2.0.2306.26232

I wll try the new release first. If it is the same, I will make a small repro.

NOTE that if I do Char.Draw(g, rc) is uses the correct colors.

Brian

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

Post by Narcís » Thu Sep 21, 2006 3:03 pm

Hi Brian,

If you want to be sure you can send us an example we can run "as-is" and I'll test it with the latest debug build and our current sources.

You can post your files at news://www.steema.net/steema.public.attachments newsgroup.
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

matthbri
Newbie
Newbie
Posts: 43
Joined: Wed Mar 22, 2006 12:00 am

Post by matthbri » Thu Sep 21, 2006 3:34 pm

OK, I have posted a testapp subject 'CopyToClipBoard'

run, click the button, and paste in 'Paint' app



Brian

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

Post by Narcís » Fri Sep 22, 2006 11:05 am

Hi Brian,

Thanks for the example. We could reproduce your problem here and found its cause. The problem is that you set the panel's brush no not visible:

Code: Select all

      tChart1.Panel.Brush.Visible = false;
Just commenting out this line will solve the issue. Also, if you don't want the spheric brush style also comment out the following line:

Code: Select all

      tChart1.Panel.Brush.Style = System.Drawing.Drawing2D.HatchStyle.Sphere;
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

matthbri
Newbie
Newbie
Posts: 43
Joined: Wed Mar 22, 2006 12:00 am

Post by matthbri » Fri Sep 22, 2006 2:51 pm

OK, thanks.

but it still seems strange that the bitmap export does not match what you see on the screen....

matthbri
Newbie
Newbie
Posts: 43
Joined: Wed Mar 22, 2006 12:00 am

Post by matthbri » Fri Sep 22, 2006 2:58 pm

Hi,

Actually this suggestion is no good. If I enable the brush, the screen appearance has now changed. it has some kind of pattern on it, dependant on the brush style.

So before the export I make the brush visible, then after the export invisible. This does what I want, but it is a workaround in my opinion, not a fix.

For your info, the previous version of TeeChart did not have this problem.
It was introduced in build 2.0.2306.26232

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

Post by Narcís » Fri Sep 22, 2006 3:27 pm

Hi matthbri,

As I said in my last post, This is because you set:

Code: Select all

      tChart1.Panel.Brush.Style = System.Drawing.Drawing2D.HatchStyle.Sphere;
To avoid this pattern afecting the image please comment that line as well.

Setting the brush not visible is like making the chart transparent. You can find the explanation of this phenomena (copying an image to the clipboard adds blue background) here.
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

matthbri
Newbie
Newbie
Posts: 43
Joined: Wed Mar 22, 2006 12:00 am

Post by matthbri » Fri Sep 22, 2006 3:31 pm

I commented out the brush style and got some kind of hashed appearance. The styles do not include a solid?

I still dont see why the export image should be different to the screen image. Doesnt make sense.

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

Post by Narcís » Mon Sep 25, 2006 7:43 am

Hi matthbri,
I commented out the brush style and got some kind of hashed appearance. The styles do not include a solid?


You already made it solid using:

Code: Select all

      tChart1.Panel.Brush.Solid = true;
I still dont see why the export image should be different to the screen image. Doesnt make sense.
Have you read the message I pointed you to? Please read that whole thread for an explanation to this.
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