///<summary>改变示波器背景色</summary> ///<param name="background">背景色</param> public void ChangeBackgroundColor(uint background) { BackColor = ColorHelper.FromArgb(background); if (m_Oscilloscope != IntPtr.Zero) { Dll.ChangeBackgroundColor(m_Oscilloscope, background); } }
///<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)); } } }