///<summary>改变水平平移</summary> ///<param name="offset">位移值</param> public void ChangeTranslateX(int offset) { if (m_Oscilloscope != IntPtr.Zero && Dll.ChangeTranslateX(m_Oscilloscope, offset) && PropertyChanged != null) { PropertyChanged(Property.TranslateX, Dll.TranslateX(m_Oscilloscope)); } }
///<summary>改变水平缩放</summary> ///<param name="offset">差值</param> public void ChangeScaleX(float offset) { if (m_Oscilloscope != IntPtr.Zero && Dll.ChangeScaleX(m_Oscilloscope, offset) && PropertyChanged != null) { PropertyChanged(Property.TranslateX_Limit, Dll.TranslateX_Limit(m_Oscilloscope)); PropertyChanged(Property.TranslateX, Dll.TranslateX(m_Oscilloscope)); PropertyChanged(Property.ScaleX, Dll.ScaleX(m_Oscilloscope)); } }
///<summary>改变水平缩放极限值</summary> ///<param name="value">值(>=1)</param> public void ChangeScaleLimitX(uint value) { if (m_Oscilloscope != IntPtr.Zero && Dll.ChangeScaleLimitX(m_Oscilloscope, value) && PropertyChanged != null) { PropertyChanged(Property.TranslateX_Limit, Dll.TranslateX_Limit(m_Oscilloscope)); PropertyChanged(Property.TranslateX, Dll.TranslateX(m_Oscilloscope)); PropertyChanged(Property.ScaleX, Dll.ScaleX(m_Oscilloscope)); PropertyChanged(Property.ScaleX_Limit, Dll.ScaleX_Limit(m_Oscilloscope)); } }
///<summary>初始化</summary> ///<param name="arg">参数</param> public void Initialize(ref ConstructionParameters arg) { if (arg != null && m_Oscilloscope == IntPtr.Zero && arg.Oscilloscopes != IntPtr.Zero) { arg.ControlHwnd = Handle; BackColor = ColorHelper.FromArgb(arg.Background); m_Oscilloscope = Dll.CreateOscilloscope(ref arg); m_IsUninitialized = m_Oscilloscope == IntPtr.Zero; if ((!m_IsUninitialized) && PropertyChanged != null) { PropertyChanged(Property.TranslateX_Limit, Dll.TranslateX_Limit(m_Oscilloscope)); PropertyChanged(Property.TranslateY_Limit, Dll.TranslateY_Limit(m_Oscilloscope)); PropertyChanged(Property.TranslateX, Dll.TranslateX(m_Oscilloscope)); PropertyChanged(Property.TranslateY, Dll.TranslateY(m_Oscilloscope)); PropertyChanged(Property.ScaleX, Dll.ScaleX(m_Oscilloscope)); PropertyChanged(Property.ScaleY, Dll.ScaleY(m_Oscilloscope)); PropertyChanged(Property.ScaleX_Limit, Dll.ScaleX_Limit(m_Oscilloscope)); PropertyChanged(Property.ScaleY_Limit, Dll.ScaleY_Limit(m_Oscilloscope)); } } }