LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Inconsistent drift between Graph data plane and PanelImage.Front coordinates

I am struggling to match the data plane size with with the PanelImage.Front.

I fail to draw circles on specific data points as seen in the code.

My premise is that I set the Graph's Plotarea to 640/480 pixels.

I expect that the PanelImage.Front has the same pixel size.

Unfortunately when trying to encircle data points the circle deviates uncosistently.

It encircles 0,0, then deviates to the top left for 39,79 and then deviates to the bottom right for 439/599

but comes back again a little for 479,639.

 

Quiztus2_0-1708425168058.png

panelimagesfront.PNG

 

Actor Framework
0 Kudos
Message 1 of 3
(371 Views)

I haven't opened the code, but the graph classes have a couple of useful features for this:

  1. They have methods to convert from pane coords to the graph XY coords and back.
  2. They have a plot bounds property which can let you convert the pane pixel coords to the graph pixel coords by subtracting the top and left from your coords.

You can then use this to convert the graph XY coordinates to pixel coordinates for the plot image regardless of the size and position of the graph.


___________________
Try to take over the world!
0 Kudos
Message 2 of 3
(298 Views)

By using Map XY to Coords the encirclements can be done correctly, which is good. Nevertheless the PlotImages.Front seems to have 2 pixels more than the plot area, which could still be a bug in my opinion.

PlotImagesFront Plotarea Dimension Mismatch.png

Quiztus2_0-1708512626866.png

 

Actor Framework
0 Kudos
Message 3 of 3
(281 Views)