LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to print graph using prthires.fp with line thickness?

Hi, I'm trying to print a graph using prthires.fp with line thickness, but when I print, the width of the line is about 1 pixel only. I even tried to SetPlotAttribute, but still didn't work. Help anyone?
0 Kudos
Message 1 of 5
(2,923 Views)
The prthires.fp instrument driver is obsolete. The line thickness is not correct, probably because the corresponding plot attribute was added to graphs after that instrument driver had been created.

The reason why prthires.fp is obsolete is because it was created as a workaround to the printing limitations of CVI prior to version 5.0. Because at one point only bitmap printing was supported, the printout quality was less than stellar. This instrument driver was created to improve the quality of graph controls in spite of bitmap printing.
Starting with CVI 5.0, non-bitmap (direct) printing was introduced, which means that the quality improvements achieved with prthires.fp was blended into what you get by default with PrintCtrl and PrintPanel (as long as ATTR_BIT
MAP_PRINTING is disabled).

Have you tried printing with those functions yet?

Luis
NI
Message 2 of 5
(2,923 Views)
Thanks for your reply. You're right about phthires.fp, I see not too much of a different between print in hi res and PrintCtrl. Yes I have tried PrintCtrl, but haven't try PrintPanel yet. I have used PrintCtrl to print and SetPlotAttribute to set the line thickness of the graph, but for some odd reason it doesn't print out the line thickness that I set to 3. I can see the line thickness on the screen, but when it print it show the line thickness of 1 pixel. However, I when I used PrintCtrl and have it print in Bitmap I can see the line thickness that I set, but the resolution is very bad. So hope you could help me or anyone could help me would be great.

Thanks,
Ken
0 Kudos
Message 3 of 5
(2,923 Views)
Ken,

I did find a bug that caused plots to not adjust their thickness to the resolution of the printer. It will be fixed in the next version of CVI.

In the meanwhile, if you would like a workaround, something that would work would be for you to change the plot thickness temporarily whenever you print. Use something like this:

GetPlotAttribute (panel, control, plotId, ATTR_PLOT_THICKNESS, &value);
SetPlotAttribute (panel, control, plotId, ATTR_PLOT_THICKNESS, value * 7);
PrintCtrl (panel, control, "", TRUE, FALSE);
SetPlotAttribute (panel, control, plotId, ATTR_PLOT_THICKNESS, value);

I picked 7 as the scaling factor, since that is something that should come fairly close in most cases. The precise number that would have to be used de
pends on a lot of factors, such as the ultimate size of the graph on the page, the resolution (dpi) of the printer, the original size of the graph in pixels, etc... but try it out, and tweak that number until you get something that will work.

Sorry for the kludge...

Luis
NI
0 Kudos
Message 4 of 5
(2,923 Views)
Thank you, Luis. With you help, I was able to print with the line thickness that I set to. So thanks.
0 Kudos
Message 5 of 5
(2,923 Views)