コード例 #1
0
ファイル: MainForm.cs プロジェクト: nolik/poit-labs
        public CDKForm()
        {
            InitializeComponent();

            tempBitmap = new Bitmap(DrawWindow.Width, DrawWindow.Height);

            graphicsField         = Graphics.FromImage(tempBitmap);
            DrawWindow.MouseDown += new MouseEventHandler(DrawWindow_MouseDown);
            DrawWindow.MouseUp   += new MouseEventHandler(DrawWindow_MouseUp);
            DrawWindow.MouseMove += new MouseEventHandler(DrawWindow_MouseMove);

            GlobalShapeColor    = Color.Black;
            GlobalShapeThikness = 5;
            currentPen          = new Pen(GlobalShapeColor, GlobalShapeThikness);

            ColorDisplayBlock.BackColor   = GlobalShapeColor;
            BrushThiknessTrackBar.Value   = GlobalShapeThikness;
            BrushThiknessText.Text        = BrushThiknessTrackBar.Value.ToString();
            BrushThiknessTrackBar.Scroll += new System.EventHandler(TrackBarScroll);

            toolList.Items.Insert(0, "Circle");
            toolList.Items.Insert(1, "Line");
            toolList.Items.Insert(2, "Rectangle");
            toolList.Items.Insert(3, "Triangle");

            buildersSet[0] = new CircleBuilder();
            buildersSet[1] = new LineBuilder();
            buildersSet[2] = new RectangleBuilder();
            buildersSet[3] = new TriangleBuilder();

            toolList.SelectedIndex = 0;

            LoadingLibraryProc();
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: Atiragram/poit-labs
        public CDKForm()
        {
            InitializeComponent();

            tempBitmap = new Bitmap(DrawWindow.Width, DrawWindow.Height);

            graphicsField = Graphics.FromImage(tempBitmap);
            DrawWindow.MouseDown += new MouseEventHandler(DrawWindow_MouseDown);
            DrawWindow.MouseUp += new MouseEventHandler(DrawWindow_MouseUp);
            DrawWindow.MouseMove += new MouseEventHandler(DrawWindow_MouseMove);

            GlobalShapeColor = Color.Black;
            GlobalShapeThikness = 5;
            currentPen = new Pen(GlobalShapeColor, GlobalShapeThikness);

            ColorDisplayBlock.BackColor = GlobalShapeColor;
            BrushThiknessTrackBar.Value = GlobalShapeThikness;
            BrushThiknessText.Text = BrushThiknessTrackBar.Value.ToString();
            BrushThiknessTrackBar.Scroll += new System.EventHandler(TrackBarScroll);

            toolList.Items.Insert(0, "Circle");
            toolList.Items.Insert(1, "Line");
            toolList.Items.Insert(2, "Rectangle");
            toolList.Items.Insert(3, "Triangle");

            buildersSet[0] = new CircleBuilder();
            buildersSet[1] = new LineBuilder();
            buildersSet[2] = new RectangleBuilder();
            buildersSet[3] = new TriangleBuilder();

            toolList.SelectedIndex = 0;

            LoadingLibraryProc();
        }