예제 #1
0
        private void SetControlColorTable()
        {
            CaptureImageToolColorTable colorTable = ColorTable;
            ToolStripRendererEx        renderer   = new ToolStripRendererEx(colorTable);

            contextMenuStrip.Renderer   = renderer;
            drawToolsControl.ColorTable = colorTable;
            colorSelector.ColorTable    = colorTable;
        }
예제 #2
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            Graphics g = e.Graphics;

            g.SmoothingMode = SmoothingMode.AntiAlias;

            g.FillRectangle(mybrush, 0, 0,
                            Screen.PrimaryScreen.Bounds.Width,
                            Screen.PrimaryScreen.Bounds.Height);


            if (SelectImageRect.Width != 0 && SelectImageRect.Height != 0)
            {
                Rectangle rect = SelectImageRect;
                DrawSelectedImage(g);
                CaptureImageToolColorTable colorTable = ColorTable;
                if (_mouseDown)
                {
                    if (!SelectedImage || SizeGrip != SizeGrip.None)
                    {
                        using (SolidBrush brush = new SolidBrush(
                                   Color.FromArgb(90, colorTable.BackColorNormal)))
                        {
                            g.FillRectangle(brush, rect);
                        }

                        DrawImageSizeInfo(g, rect);
                    }
                }

                using (Pen pen = new Pen(colorTable.BorderColor))
                {
                    g.DrawRectangle(pen, rect);

                    using (SolidBrush brush = new SolidBrush(colorTable.BackColorPressed))
                    {
                        foreach (Rectangle sizeGripRect in SizeGripRectList.Values)
                        {
                            g.FillRectangle(
                                brush,
                                sizeGripRect);
                        }
                    }
                }

                DrawOperate(g);

                if (DrawStyle != DrawStyle.None)
                {
                    DrawTools(g, _endPoint);
                }
            }
        }
예제 #3
0
 public ToolStripRendererEx(CaptureImageToolColorTable colorTable)
     : base()
 {
     _colorTable = colorTable;
 }