Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Retreiving WMF object and saving it to a file

Hi,
I'm using Labwindows/CVI 6.0 and I'm doing some testing for a print process.

Where I get stuck is after retreiving an image object of form WMF with ControlImage or GraphImages I can't find a way to save it to a .wmf file (which would be suitable for my app) or directly print it.

I must say I do not have much experience handling that kind of thing.

Francis
Tech R&D
Vulcain Alarme Inc.
0 Kudos
Message 1 of 4
(3,511 Views)
There isn't native CVI functions for dealing with this. If you are trying to print an ActiveX control through CVI, you can just use the CVI PrintCtrl function. It supports ActiveX controls. If you want to save it an image of the ActiveX control to a file you can call GetCtrlDisplayBitmap, then SaveBitmapToFile from the Programmer's Toolbox like:

GetCtrlDisplayBitmap (panel, PANEL_CWGRAPH, 0, &hBitmap);
SaveBitmapToFile ("c:\\test.bmp", hBitmap);


You can deal with the metafile in CVI instead, but you would have to use SDK programming and it would be much more difficult. Post back if you have more questions.

Best Regards,

Chris Matthews
National Instruments
Message 2 of 4
(3,511 Views)
Hi I have CVI 5.0 and I don't think I have SaveBitmapToFile() in my programmer's toolbox. Is there anyway to download the newer version ?
0 Kudos
Message 3 of 4
(3,511 Views)
No, sorry, we added it in CVI 5.5. You would need to upgrade to get the function. You can upgrade on our website at http://www.ni.com/upgrade.

Chris
0 Kudos
Message 4 of 4
(3,511 Views)