LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to print a panel using"printpanel()"function in black-white mode

Hi,
    Now I want to print a panel including the controls out using black-white printer. However, the panel are colorful, including green,red, grey or other colors, it would be not so so clear when printed out.
    So how to get rid of the color information, means that, changing the colorful picture into black-white to get a clear white printing with a black-white printer.
   Any suggestions? Thanks!
                                                        LIXiaogai
0 Kudos
Message 1 of 5
(3,590 Views)
When printing on laser or inkjets in no-color mode I usually use SetPrintAttribute (ATTR_COLOR_MODE, VAL_GRAYSCALE); obtaining good results. The stricter limit of using VAL_BW option is useful when preparing a report on a panel (white background and all elements -texts and drawings- in black, without any intermediate color) and next printing it: if you use it with color panel some colors will be printed as solid black so loosing all details about them.


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 5
(3,591 Views)
Hi, Roberto,
     Thanks very much! I've tried as you suggested. However, still not so perfect. Since the corlor of curve is red, and it is very close to the color of the graph background .
     So, I wonder if we could directly change the colorful colors to black and white. I mean, could we change all the "red" into "black", "green" into "white", then when use VAL_BW will get perfect result.
     Thanks!
                                      LIXiaogai
0 Kudos
Message 3 of 5
(3,574 Views)

I'm not aware of a global function that changes all reds in black and so on as you say: you should go through all elements and explicitly change the colors.

Another way could be to obtain the image of the panel in a bitmap and work directly on it, but it's not so simple a solution as you may want! Smiley Surprised

When deciding to obtain a report that includes graphs and numerics, I usually prepare a second panel with proper colors (background and foreground, white and black respectively) and then load this second panel (without displaying it), copy all values and plots to this panel and print it instead of the original one: maybe you can think of a similar solution in your application.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 4 of 5
(3,570 Views)
Hi,Roberto,
Thanks very much for your suggestion, sounds a good idea. And I have tried as you said, and it indeed work. However, a little prolixity. Since I have to add the code lines to both the original panel and also the same to the second copyed one.
Thanks again!Regards!
                                  LIXiaogai
0 Kudos
Message 5 of 5
(3,543 Views)