コード例 #1
0
        private void PictureBoxCanvas_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.Button.HasFlag(MouseButtons.Left))
            {
                var cmd = new DrawCommand(canvas, e.Location);
                history.Append(cmd);

                cmd.Execute();
                pictureBoxCanvas.Refresh();
            }
        }
コード例 #2
0
        public DrawCanvas(Image image, MacroCommand history)
        {
            g = Graphics.FromImage(image);

            this.history = history;

            history.Append(new ColorCommand(this, color));
        }