Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Are there properties to set the size of the 3D Graph control?

I can't find any but not sure if they exist or just that I'm not looking hard enough.
0 Kudos
Message 1 of 3
(3,333 Views)
There aren't any properties on the 3D graph to do this, but there are methods that are inherited from CWnd (CNiGraph3D inherits from CNiControl, which inherits from CWnd) that let you do this, namely MoveWindow and SetWindowPos. I prefer SetWindowPos because it allows you to specify that the position parameters should be ignored, hence you don't have to worry about getting the position to specify in the parameters.

For example, assuming you have a CNiGraph3D on a dialog and a member variable for it called m_graph3D, the code to resize it to 400x300 would look like this:

m_graph3D.SetWindowPos(NULL, 0, 0, 400, 300, SWP_NOMOVE | SWP_NOZORDER);

- Elton
Message 2 of 3
(3,335 Views)
I had the same question, and a simple (tho sorta make-shift) solution is to use SetViewDistance(DOUBLE)

ex:

m_graph.SetViewDistance(1); //1 is roughly the same viewing distance as the default
// >1 = zoom-out
// <1 = zoom-in

..hope it helps if anyone else needs it,
SuperRyan
0 Kudos
Message 3 of 3
(3,301 Views)