Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

save, print and copy to clipboard a cw3dgraph control

Hello,

i write an application to visualize some data in a
3D-graph. the requirements says to print the picture
to save it and to copy it into the windows clipboard.

my problem is, i don't know to get access to the
control to execute these three steps.

i hope there is someone, who can explain me the steps
to print a complete cw3dgraph (incl. title, axes,
labels, text, etc.) to the printer or to save it in
a file or to copy the control to the clipboard.

thank you very much.

sincerely,
maxmerlin
0 Kudos
Message 1 of 2
(3,122 Views)
For an example of how to print the graph, see the printing example in the Examples\Ui\Common\Printing directory under the Measurement Studio for Visual C++ installation directory. This example demonstrates how to print with CNiGraph, but CNiGraph3D also has the ControlImage method that returns an enhanced metafile of the control, so it will work exactly the same way.

This snippet demonstrates how to copy the graph to the clipboard:

// Assuming that the class has a m_graph member that is a CNiGraph3D
CNiPicture pic = m_graph.ControlImage();

::OpenClipboard(NULL);
::EmptyClipboard();
::SetClipboardData(
CF_ENHMETAFILE,
::CopyEnhMetaFile(reinterpret_cast(pic.Handle), NULL)
);
::CloseClipboa
rd();

- Elton
Message 2 of 2
(3,122 Views)