Inheritance: IDisposable
示例#1
0
        public override void Initialize()
        {
            GDIpInterop gdip  = new GDIpInterop(this.Width + 1, this.Height + 1);
            var         brush = new System.Drawing.Drawing2D.LinearGradientBrush(new System.Drawing.Rectangle(0, 0, this.Width, this.Height), System.Drawing.Color.White, System.Drawing.Color.LightGray, 90f);
            var         pen   = new System.Drawing.Pen(System.Drawing.Color.Black, 1f);

            gdip.g.FillRectangle(brush, new System.Drawing.Rectangle(0, 0, this.Width, this.Height));
            gdip.g.DrawRectangle(pen, new System.Drawing.Rectangle(0, 0, this.Width, this.Height));
            this.Texture = gdip.SaveTexture();
            gdip.Dispose();

            _fnt = new Font(DefaultFontFileName, 18)
            {
                EnableShadow  = true,
                ShadowColor   = Color.Black,
                ShadowYOffset = 1,
            };

            _title = new Label()
            {
                Font   = _fnt,
                Color  = Color.White,
                Margin = Origins.Center,
            };

            Controls.Add(_title);
            this.Color = BaseColor;
            base.Initialize();
        }
示例#2
0
        public override void Initialize()
        {
            var gdip   = new GDIpInterop(141, 24);
            var pointc = new System.Drawing.Point[4];

            pointc[0] = new System.Drawing.Point(10, 0);
            pointc[1] = new System.Drawing.Point(131, 0);
            pointc[2] = new System.Drawing.Point(141, 24);
            pointc[3] = new System.Drawing.Point(0, 24);
            var brush = new System.Drawing.Drawing2D.LinearGradientBrush(new System.Drawing.PointF(0, 0), new System.Drawing.PointF(0, 24), System.Drawing.Color.FromArgb(255, 255, 255, 236), System.Drawing.Color.FromArgb(255, 98, 98, 98));
            var pen   = new System.Drawing.Pen(System.Drawing.Color.FromArgb(255, 117, 117, 117), 2f);

            gdip.g.DrawPolygon(pen, pointc);
            gdip.g.FillPolygon(brush, pointc);
            this.Texture = gdip.SaveTexture();
            this.Width   = Texture.Width;
            this.Height  = Texture.Height;
            this.Color   = Color.White;

            _tabtitle = new Label()
            {
                Font   = _fnt,
                Color  = Color.Black,
                Top    = 3,
                Margin = Origins.TopCenter,
            };

            Controls.Add(_tabtitle);

            base.Initialize();
        }
示例#3
0
        public override void Initialize()
        {
            var gdip = new GDIpInterop(5, 30);

            gdip.g.FillRectangle(System.Drawing.Brushes.White, new System.Drawing.Rectangle(0, 0, 5, 32));
            _scroll = gdip.SaveTexture();
            base.Initialize();
        }
示例#4
0
        public override void Initialize()
        {
            var gdip = new GDIpInterop(_width, _height);

            gdip.g.FillRectangle(System.Drawing.Brushes.White, new System.Drawing.Rectangle(-1, -1, _width + 1, _height + 1));
            gdip.g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.Default;
            this.Texture         = gdip.SaveTexture();

            gdip.g.Clear(System.Drawing.Color.Transparent);
            gdip.g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;

            var pointa = new System.Drawing.Point[3];

            pointa[0] = new System.Drawing.Point(_width - 25, (int)(_height / 2) - 5);
            pointa[1] = new System.Drawing.Point(_width - 10, (int)(_height / 2) - 5);
            pointa[2] = new System.Drawing.Point(_width - 17, (int)(_height / 2) + 5);
            gdip.g.FillPolygon(System.Drawing.Brushes.White, pointa);
            _tex = gdip.SaveTexture();

            this.Width  = Texture.Width;
            this.Height = Texture.Height;
            this.Color  = Color.Black;
            _title      = new Label()
            {
                Font   = _fnt,
                Color  = Color.White,
                Margin = Origins.CenterLeft,
                Left   = 5,
            };
            Controls.Add(_title);
            if (Type == ItemType.Separator)
            {
                this.Color  = SepColor;
                _title.Left = 20;
                gdip.g.Clear(System.Drawing.Color.Transparent);
                pointa    = new System.Drawing.Point[3];
                pointa[0] = new System.Drawing.Point(6, (int)(_height / 2) - 8);
                pointa[1] = new System.Drawing.Point(6, (int)(_height / 2) + 8);
                pointa[2] = new System.Drawing.Point(16, (int)(_height / 2));
                gdip.g.FillPolygon(System.Drawing.Brushes.Black, pointa);
                _septex = gdip.SaveTexture();
            }
            gdip.g.Dispose();
            base.Initialize();
        }
示例#5
0
        public override void Initialize()
        {
            var gdip = new GDIpInterop(this.Width, 16);

            gdip.g.DrawLine(System.Drawing.Pens.White, new System.Drawing.Point(0, 7), new System.Drawing.Point(this.Width, 7));
            gdip.g.FillRectangle(new System.Drawing.SolidBrush(System.Drawing.Color.FromArgb(10, 255, 255, 255)), new System.Drawing.Rectangle(0, 0, this.Width, 15));
            this.Texture = gdip.SaveTexture();
            this.Color   = LineColor;
            this.Height  = 16;
            gdip.g.Clear(System.Drawing.Color.Transparent);
            gdip.g.FillEllipse(System.Drawing.Brushes.White, new System.Drawing.Rectangle(0, 0, 15, 15));
            _scrollcircle = gdip.SaveTexture();
            gdip.g.Dispose();
            this.MouseMove += TrackBar_MouseMove;
            this.MouseDown += TrackBar_MouseDown;
            this.KeyDown   += TrackBar_KeyDown;
            Value           = MinValue;
            base.Initialize();
        }
示例#6
0
        public override void Initialize()
        {
            GDIpInterop gdip = new GDIpInterop(20, 20);

            gdip.g.FillEllipse(System.Drawing.Brushes.White, 2, 2, 16, 16);
            full = gdip.SaveTexture();

            gdip.g.Clear(System.Drawing.Color.Transparent);
            System.Drawing.Pen p = new System.Drawing.Pen(System.Drawing.Color.White, 2);
            gdip.g.FillEllipse(new System.Drawing.SolidBrush(System.Drawing.Color.FromArgb(10, 255, 255, 255)), 2, 2, 16, 16);
            gdip.g.DrawEllipse(p, 2, 2, 16, 16);
            empty = gdip.SaveTexture();

            _fnt = new Font("msyh.ttc", 15)
            {
                EnableShadow  = true,
                ShadowColor   = Color.Black,
                ShadowYOffset = 1,
            };
            _checkcircle = new Control()
            {
                Texture = empty,
                Margin  = Origins.CenterLeft,
                Left    = 0,
                Color   = CircleColor
            };
            _checkcircle.Width  = _checkcircle.Texture.Width;
            _checkcircle.Height = _checkcircle.Texture.Height;
            _checkcircle.Click += CheckBox_Click;

            _title = new Label()
            {
                Font   = _fnt,
                Color  = Color.White,
                Margin = Origins.CenterLeft,
                Left   = 22,
            };
            Controls.Add(_title);
            Controls.Add(_checkcircle);
            this.Width  = full.Width;
            this.Height = full.Height;
            base.Initialize();
        }
示例#7
0
        public override void Initialize()
        {
            var gdip = new GDIpInterop(141, 24);
            var pointc = new System.Drawing.Point[4];
            pointc[0] = new System.Drawing.Point(10, 0);
            pointc[1] = new System.Drawing.Point(131, 0);
            pointc[2] = new System.Drawing.Point(141, 24);
            pointc[3] = new System.Drawing.Point(0, 24);
            var brush = new System.Drawing.Drawing2D.LinearGradientBrush(new System.Drawing.PointF(0, 0), new System.Drawing.PointF(0, 24), System.Drawing.Color.FromArgb(255,255,255,236), System.Drawing.Color.FromArgb(255, 98, 98, 98));
            var pen = new System.Drawing.Pen(System.Drawing.Color.FromArgb(255, 117, 117, 117), 2f);
            gdip.g.DrawPolygon(pen, pointc);
            gdip.g.FillPolygon(brush, pointc);
            this.Texture = gdip.SaveTexture();
            this.Width = Texture.Width;
            this.Height = Texture.Height;
            this.Color = Color.White;

            _tabtitle = new Label()
            {
                Font = _fnt,
                Color = Color.Black,
                Top =3,
                Margin = Origins.TopCenter,
            };

            Controls.Add(_tabtitle);

            base.Initialize();
        }