示例#1
0
 /// <summary>
 /// Fills the interior of a rectangle specified by a RectangleF structure.
 /// </summary>
 /// <param name="g">The Graphics to draw on.</param>
 /// <param name="brush">StiBrush object that determines the characteristics of the fill.</param>
 /// <param name="rect">RectangleD structure that represents the rectangle to fill.</param>
 public static void FillRectangle(Graphics g, StiBrush brush, RectangleF rect)
 {
     using (Brush br = StiBrush.GetBrush(brush, rect))
     {
         FillRectangle(g, br, rect);
     }
 }
示例#2
0
        /// <summary>
        /// Draws shadow on the indicated Graphics.
        /// </summary>
        /// <param name="g">Graphics on which a border can be drawn.</param>
        /// <param name="rect">The rectangle that indicates an area of the border drawing.</param>
        /// <param name="zoom">The scale of a border to draw.</param>
        public virtual void DrawBorderShadow(Graphics g, RectangleF rect, float zoom)
        {
            if (IsDefault)
            {
                return;
            }
            if (bits == null)
            {
                return;
            }
            if (bits.DropShadow)
            {
                float      dist  = (float)(bits.ShadowSize * zoom);
                RectangleF rect2 = new RectangleF(rect.Left + dist,
                                                  rect.Top + dist, rect.Width, rect.Height);

                using (Brush brush = StiBrush.GetBrush(ShadowBrush, rect2))
                {
                    g.FillRectangle(brush,
                                    rect.Right, rect.Top + dist, dist, rect.Height - dist);
                    g.FillRectangle(brush,
                                    rect.Left + dist, rect.Bottom, rect.Width, dist);
                }
            }
        }