求助!请问各位师兄graph视区的缩放和移动用代码怎么实现?
SetCtrlAttribute (, , ATTR_ZOOM_STYLE, );兄弟试试用这个属性设置的控件!
找到解决办法了!
谢谢版主的帮忙。我试了版主说的那条语句,不过它只能设置graph控件的zoom Style属性,
后来我从帮助文件中找到了SetAxisScalingMode (int panelHandle, int controlID, int axis, int axisScaling, double min, double max)函数;
int SetAxisScalingMode (int panelHandle, int controlID, int axis, int axisScaling, double min, double max);
PurposeSets the scaling mode and the range of a graph axis or the scaling mode and the range of a y-axis of a strip chart.
This function is not valid for the x-axis of a strip chart. To set the x-offset and x-increment for a strip chart, use the SetCtrlAttribute function with the ATTR_XAXIS_OFFSET and ATTR_XAXIS_GAIN attributes.
When you call this function on a digital graph, LabWindows/CVI rounds the min and max values to the closest integer value.
可以用它来设置graph控件视口左右端的X轴坐标,进而实现看似移动和缩放的效果。 :handshake :loveliness: 好样的兄弟! 8.5 里控件有增强的zoom 功能 allqq-mogudiandian-102all 本身Graph控件就带有这个功能的,在graph palette中! 谢谢 {:4_372:}
页:
[1]