02-24-2011 05:34 AM
Hi,
I'm using Measurement Studio 2010 for .Net, Win7 64bit, VS2008, scatter graph.
when trying to use the ToImage method the image quality is very bad.
Please see attached images. one image was done using the ToImage method and the other a simple print screen.
Is there a way to get a good quality graph image?
thanks in advance for you help,
Oren
02-25-2011 05:40 PM
Hi Oren,
I tried using the same toImage function with a ScatterGraph on my machine with Measurement Studio 2010 in Visual Studio 2008 and I wasn't seeing the same type of poor image quality that you did. Would you mind putting your code up for us to download and try out over here?
Regards,
Stephanie R.
National Instruments
02-27-2011 05:12 AM
Hi Stephanie,
Thanks for the prompt reply. I tried now to create a new project added a new ScatterGraph and the problem did not occur. So I took my form stripped it from all components and code other than the ScatterGraph and the tried again. The problem occurs.
I attached the project with the rebellious ScatterGraph.
Just run the project. Click the ToClipboard button and paste the image somewhere. You should see the problem now.
By the way, this project demos the ToClipboard, but the ToImage malfunction the same way.
Thanks for the help,
Oren
02-28-2011 01:56 PM
Hi Oren,
I took a look at your code and it exhibited the same behavior over here on my machine, too -- with both the ToImage() and ToClipboard() functions. I think your code is returning these bad results because the graph is located on a tab control. When you remove the tab control and then send the graph to an image or to the clipboard, the quality is much higher.
The same behavior is occuring with Visual Studio 2010, as well. I have filed a corrective action request (#286749) to R&D for this particular issue. When any new updates on the matter come out, we will update you. Thank you for your feedback on this matter!
Regards,
Stephanie R.
National Instruments
02-28-2011 02:50 PM
Hi Stephanie,
It is great you found the problem!
Unfortunately it is already build in to our software that the graph is located on a tab control is there a work around I can do in the mean time?
Do you have a rough estimation how long will it take until an update will be released?
Thanks again,
Oren
03-01-2011 06:44 PM
Hi Oren,
One thing you may want to look at is one of the shipping examples, titled Snippets.2008.sln. This is found in Start >> All Programs >> National Instruments >> Measurement Studio 2010 for Visual Studio 2008 >> .NET Examples >> Application >> UISnippets. This example uses a ScatterGraph inside a tab control, and saving it to a file or copying it to the clipboard does not cause that strange drop in resolution that you saw.
I am not sure how long it will take for an update to be released, but we will let you know when this happens. You can also keep an eye on the request made to R&D (286749) as any new updates will also be posted there.
Regards,
Stephanie R.
National Instruments
03-02-2011 05:31 PM
Hi Oren,
R&D has found a workaround for this issue, and I would like to pass it along to you. If you set a color to the control or tabPage's BackColor property, then the drop in resolution should disappear. For example, If you set
scatterGraph1.BackColor = Color.Black;
then when you copy the image over the the clipboard, it should transfer as is.
Hopefully this helps!
Regards,
Stephanie R.
National Instruments
03-02-2011 05:41 PM
Hi Stephanie,
That looks much better!
Thanks for the prompt responses and the quick workaround!
Best regards,
Oren