//--------------------------------------------------------------------- // Constructor //--------------------------------------------------------------------- public CanvasWindow(int width = 200, int height = 200, string name = "New Picture") { InitializeComponent(); this.Text = name; m_picture = new Picture(width, height, name); this.SetClientSizeCore((int)(m_picture.Width), (int)(m_picture.Height)); m_panTool = new PanTool(this); m_zoomTool = new ZoomTool(this); SetZoom(1.0f, false); this.canvasBox.MouseDown += new MouseEventHandler(ProcessMouseDown); this.canvasBox.MouseUp += new MouseEventHandler(ProcessMouseUp); this.canvasBox.MouseMove += new MouseEventHandler(ProcessMouseMove); this.WindowState = FormWindowState.Maximized; this.MaximizeBox = false; this.MinimizeBox = false; this.ControlBox = false; //this.KeyDown += (object a, KeyEventArgs b) => ProcessKeyDown(b.KeyData); //this.KeyUp += (object a, KeyEventArgs b) => ProcessKeyUp(b.KeyData); }
//--------------------------------------------------------------------- // Constructor //--------------------------------------------------------------------- public CanvasWindow(int width = 200, int height = 200, string name = "New Picture") { InitializeComponent(); this.Text = name; m_picture = new Picture(width, height, name); this.SetClientSizeCore((int)(m_picture.Width), (int)(m_picture.Height)); m_panTool = new PanTool(this); m_zoomTool = new ZoomTool(this); SetZoom(1.0f, false); this.canvasBox.MouseDown += new MouseEventHandler(ProcessMouseDown); this.canvasBox.MouseUp += new MouseEventHandler(ProcessMouseUp); this.canvasBox.MouseMove += new MouseEventHandler(ProcessMouseMove); this.WindowState = FormWindowState.Maximized; this.MaximizeBox = false; this.MinimizeBox = false; this.ControlBox = false; tabletPressure = 1.0f; }