LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

printctrl

Hi. I wish to use the 'print to file" option of printctrl in Labwindows 7.1 to allow me to save data displayed in a canvas and a graph control. I can print ok, but any saved files are saved without a file extension. I have tried using *.eps as suggested by an article in Knowledgebase, but I cannot open the files. How do I save fo file (from printctrl) in a format that I can use with other programs.
0 Kudos
Message 1 of 4
(3,241 Views)
The "print to file" option produces a print output file, that is a file intended to be directed to the printer at a later moment.

In case you want to retrive an image of the control, save it to disk and reuse as an image in other programs (paint, word, excel...) you can save the control bitmap to a file using SaveCtrlBitmap or similar functions provided from CVI.


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?
0 Kudos
Message 2 of 4
(3,232 Views)
Thanks. I am using SaveCtrlDisplayToFile at the moment to save the bitmap to file. The way the program works for the Canvas control is to build up the display from a series of single line bitmaps, so there is no single bitmap of the whole display to save, except from the control. The problem with this approach is that it always saves to the same file name, whereas I want the user to be able to define a file name that is meaningful to the data being saved, so I still have a bit of work to do.

My concern with the "save to file" option in PrintCtrl is that if it is there, a user will try to use it (probably incorrectly) and so I was hoping that the save file could be displayed. According to the documention, the saved image from PrintCtrl should be viewable in Microsoft Word, but this does not seem to work in my program.
0 Kudos
Message 3 of 4
(3,208 Views)
SaveCtrDisplayToFile() accepts a file pathaname under "path" parameter, so you can save to whichever file you want. If you want the user be able to navigate in the disk and set its own file name and position, you can add FileSelectPopup before saving the control to disk, passing the pathname obtained from FileSelectPopup to SaveCtrlDisplayToFile function.


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?
0 Kudos
Message 4 of 4
(3,200 Views)