LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to draw using CVI

Hi.

I have to create an application that makes drawings with high precision.
It's very important to obtain on paper drawings with precision. So the relation between
Cvi and printer is important. On this project I am in the phase of research so I know very little on what can I
do with cvi in this area. I saw the canvas.prj example and I think that I am on the right direction.

I want to know if canvas is the only way to draw on cvi (rectangles, cearcles, lines, etc.)
and if I can obtain using a printer a precise drawing on paper.


I found the CanvasDrawRect function and I like to know if the dimension of the rectangle
is in milimeters.

rectVal=MakeRect (top, left, height, width);
CanvasDrawRect (panelHandle, PANEL_CANVAS, rectVal,VAL_DRAW_FRAME_AND_INTERIOR);

Please advise me on this subject.

Thanks.
0 Kudos
Message 1 of 3
(3,399 Views)
Hello,

To put you on a second (side-)track:
there is an example in samples\userint\custctrl\cviogl for Open GL.
This allows to create commands for vector-drawing. By changing window-size the same drawing can be shown in more details. However: printing is only supported by copying a cviogl-control to a bitmap, and subsequently by sending this bitmap to a printer.

Have you already answered the first question for bitmap drawing: is the resolution of a bitmap is sufficient?
0 Kudos
Message 2 of 3
(3,393 Views)
Actually, the rect functions (and all other CVI drawing functions) are based on pixel measurements. This means that when you specify width and height of objects to be drawn, you will be setting the width and height in pixels. Now, the number of pixels per inch (or mm, cm, etc.) is dependent on your resolution of your system. Because of this, CVI doesn't know if it's exactly a 3 inch rectangle, circle, or whatever you draw. It only knows the size in pixels. Your best bet to line up with a printer would be to probably look into the Windows SDK for any printer bounds settings or resolution settings to be able to calculate how many pixels it will take for you to draw say, an 8.5 x 11 inch image. Then, you should be able to figure out how large of a canvas you would need. Hope this helps!
Jeremy L.
National Instruments
0 Kudos
Message 3 of 3
(3,355 Views)