Quantcast
Channel: LabWindows/CVI topics
Viewing all articles
Browse latest Browse all 5357

NewCtrl vs DrawCanvas Coordinate System

$
0
0

I created a new control using

 int control = NewCtrl (panelHandle, CTRL_ROUND_LED, 0, y, x);

and then I drew a line using the same coordinate (x,y) using the code below.

I expected the cross hair lines to be at least near the newly created LED, 

but they are not.  They are far away.  The CanvasDrawLine(), I think

is using the top-left as the origin.  The NewCtrl() seems NOT.

How do I reconcile the coordinates used in CanvasDrawLine() and

NewCtrl() functions.

 

Point start, end;

start.x = x - 50; end.x = x + 50;
start.y = y; end.y = y;
CanvasDrawLine(panelHandle, canvas, start, end);

start.x = x; end.x = x;
start.y = y - 50; end.y = y + 50;
CanvasDrawLine(panelHandle, canvas, start, end);

 

 


Viewing all articles
Browse latest Browse all 5357

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>