コード例 #1
0
        protected override bool OnExposeEvent(Gdk.EventExpose evnt)
        {
            Graphics g     = Gtk.DotNet.Graphics.FromDrawable( evnt.Window );
            //fill background
            Color c1       = this.Color1;
            Color c2       = this.Color2;
            Rectangle rect = new Rectangle( Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height );
            Brush b        = new LinearGradientBrush(rect, c1, c2, 90, true );
            g.FillRectangle( b, rect );

            //draw border
            SolidBrush bb   = new SolidBrush( Color.FromArgb( 147, 148, 166 ) );
            GraphUtil g2    = new GraphUtil( g );
            Pen border_pen  = new Pen(bb, 1F );
            g2.DrawRoundRectangle( border_pen,0, tail_height, Allocation.Width - 2, Allocation.Height - tail_height - 1, round_rect_angle );

            //draw tail background again to hide the bottom line

            Point[] points  = new Point[]
            {
                new Point( tail_left  , tail_height + 1 ),
                new Point( tail_left  , 0           ),
                new Point( tail_width , tail_height + 1 )
            };
            g.FillPolygon( b, points );

            //draw tail border
            points  = new Point[]
            {
                new Point( tail_left - 1 , tail_height ),
                new Point( tail_left     , 1           ),
                new Point( tail_width -1 , tail_height )
            };
            g.DrawLine( border_pen, points[0], points[1] );
            g.DrawLine( border_pen, points[1], points[2] );
            return base.OnExposeEvent (evnt);
        }
コード例 #2
0
 private void UpdateCMYK()
 {
     ColorRGB = GraphUtil.CMYK_to_RGB(ColorCMYK);
     UpdatePreview();
 }