Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

problems with copying graphs containing a region

Hi,
 
I apologize in advance, because I'm sure this has been asked before, but I don't seem to be able to find the magic keywords to make it show up.
 
Our application (C#) has been using v 6.0.3.594 of the cwui.ocx controls, specifically the CWGraph control.  We recently upgraded to v 8.0.11.318 and have seen a difference in the output when copying the graphs to a metafile.
We generated graphs with the same version of our application, one using V 6 of CWGraph, one using V 8. We like the graph V 6 sends to the metafile, but V 8's output doesn't work for us. 
 
Specifically-  
A scatterplot graph is generated and the user draws a region on the graph. They then manually rescaling the graph so that only a portion of the region is visible.  However, when we call CWGraph.ControlImage() and cast the result to type metafile, in V6 the portion of the region that is outside the graph scale has been cropped off, and in V8 the region is shown in its entirety far outside the bounds of the graph.
 
Anything we can do to get V 8 to produce a metafile like V 6 produces?
 
Neil
0 Kudos
Message 1 of 8
(4,221 Views)
Hi Neil,

There should have been no change in functionality for CWGraph between version 6 and version 8. Are you able to post a simplified example of your problem in both versions?


Adam

National Instruments
Applications Engineer
0 Kudos
Message 2 of 8
(4,199 Views)

Hi Adam,

Here is a bitmap showing the difference between the output of V6 vs. V8.  These two copied graphs came from the same source code (our C# code) running two different versions of cwui.ocx.  We used the AxCWGraph.ControlImage() function.  I can put together example code that reproduces the problem if this isn't enough info.

Neil

 

0 Kudos
Message 3 of 8
(4,191 Views)
Hi Neil,

It does look like there is a noticeable discrepancy between the two outputs. If you would post a simplified version of your code that still has the abnormal behavior I will bring it to the attention of our development team.
Adam

National Instruments
Applications Engineer
0 Kudos
Message 4 of 8
(4,144 Views)

Hi Adam,

Here is the example.  As I mentioned previously, V6 seems to give me the output I expect.  However, it appears that the problem does not show up until I use the Graphics object to copy to the Metafile mf.  The metafile I get back from the call to ControlImage seems to be right, though the square annotation lines clearly extend off the edge of the graph.  This gives me some hope that I can find a work around.

0 Kudos
Message 5 of 8
(4,128 Views)

I found a work around to the problem.  I defined a Clip Region on the Graphics grfxMetafile object in the supplied code.  Setting the Region size to the size of the orginal graph cuts off the extra annotation rectangle that I don't want.  The ends of the annotation rectangle sort of hang off the edge of the graph over the graphs border, but at least it doesn't give me the whole annotation region on the clipboard.

Neil

0 Kudos
Message 6 of 8
(4,113 Views)
Hey Neil,

I am glad you found a work around. I will to notify the development team of this behavior.


Adam

National Instruments
Applications Engineer
0 Kudos
Message 7 of 8
(4,104 Views)
Hi Adam,
Is there any word on whether or not this issue would be fixed and available soon?  While I have found a workaround for our current development efforts, the existence of this issue creates a tremendous amount of problems for supporting older versions of our applications.  It is stalling some of our customers from being able to upgrade any of our applications that use the control.  Any update would be appreciated.
 
Neil
 
0 Kudos
Message 8 of 8
(3,985 Views)