gb2004hbxf 发表于 2008-5-22 10:56:14

求助!请问各位师兄graph视区的缩放和移动用代码怎么实现?

cpubbs 发表于 2008-5-23 22:30:30

SetCtrlAttribute (, , ATTR_ZOOM_STYLE, );
兄弟试试用这个属性设置的控件!

gb2004hbxf 发表于 2008-5-28 11:30:30

找到解决办法了!

谢谢版主的帮忙。
我试了版主说的那条语句,不过它只能设置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轴坐标,进而实现看似移动和缩放的效果。

cpubbs 发表于 2008-5-28 12:18:02

:handshake :loveliness: 好样的兄弟!

xinbada163 发表于 2008-5-30 22:04:49

8.5 里控件有增强的zoom 功能

s2149zx 发表于 2009-7-23 14:30:02

allqq-mogudiandian-102all

ryancheng82 发表于 2010-8-23 15:24:47

本身Graph控件就带有这个功能的,在graph palette中!

xielin151 发表于 2010-7-29 20:06:22

谢谢

gds618 发表于 2011-3-15 09:40:28

{:4_372:}
页: [1]
查看完整版本: 求助!请问各位师兄graph视区的缩放和移动用代码怎么实现?