LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Resolution of a drawing in CVI

Hi.

I need to create drawings using CVI. I build a canvas with dimension of a paper A4 (1184x832pixels=297x210mm).
I made a calculation and I find out that 1pixel=0.25mm. So I was happy at the beginning but, when I start to draw I find out that the dimmensions of a rectangle is integer. I need to draw with a higher resolution.

Ex: I need to draw an rectangle 13x1.7mm

There is a solution for my problem?

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

From what I understand, you are concerned that you can only display 1.75mm for the side of your rectangle, and not exactly 1.70mm as you need in your application. Are you sure that your printer is capable of printing something as accurately as a 0.05mm or 50.0um. This is fairly small.

I would like to ask you for more information about your application, and why you would need to print a rectangle this accurately. Specifically, I am curious what type of printer you will be using to print this image.

Scott Y
NI
0 Kudos
Message 2 of 6
(3,773 Views)
Hi,

I use the HP LaserJet 4350 PCL 6 printer and it is a profesional printer. It defenetly can print that
dimension. My aplication will create automaticaly a rectangle with dimension given from the keyboard. This are
mecanical drawings and that's why I need them to be precise. Now, I'm not sure that CVI can give me that.

First I tried to draw on a canvas. The function for the rectangle is like this:

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

but top,left,height,width are integer.

I tried with the graph. I made my drawing at my dimmesions but when I print it, the dimension are
different.

double topMM=0,leftMM=0,widthMM=0;
double mm=1/.21;//(1pixel = 0.21mm)
double width_bit1=0.9*mm,space=1.3*mm;
double left_bit1=width_bit1+space;
double heightMM=13*mm;


plot = PlotRectangle (panelHandle, PANEL_GRAPH, width_bit1+leftMM, heightMM, leftMM, topMM,VAL_TRANSPARENT,
VAL_BLACK);

status = PrintCtrl (panelHandle, PANEL_GRAPH, "", 1, 1);

Thanks.
0 Kudos
Message 3 of 6
(3,763 Views)
Hello Tmaxial,

I noticed in your code that you used 1 pixel = .21 mm instead of 1 pixel = .252 mm. Is this the cause of the incorrect dimensions in your printout? Also, specifically how inaccurate was your printout?

Thanks.
Wendy L
LabWindows/CVI Developer Newsletter
Message 4 of 6
(3,740 Views)
Hi.
My probleme is resolved because I put the right mesurement 1pixel=0.252mm, but when I put my aplication on a WIN98 system it appairs that the resolution is different because it give me an small error. Is there another resolution for win98?

Thanks.
0 Kudos
Message 5 of 6
(3,695 Views)
Hello Tmaxial,

You mentioned that you were seeing a small error. I noticed that the conversion from pixels to mm are different in the horizontal and vertical direction. For instance, using the paper dimensions you provided in a previous post (1184x832pixels=297x210mm), you get the following two conversions:

1 pixel = 297 / 1184 = 0.2508 mm -- or --
1 pixel = 210 / 832 = 0.2524 mm. If you use the first conversion (1 pixel = 0.2508) do you see the same error?

Thanks.
Wendy L
LabWindows/CVI Developer Newsletter
0 Kudos
Message 6 of 6
(3,666 Views)