/// <summary>
        /// Paints a component.
        /// </summary>
        /// <param name="e">Argument for painting.</param>
        public override void Paint(StiPaintEventArgs e)
        {
            InvokePainting(this, e);

            if (!e.Cancel)
            {
                Graphics g = e.Graphics;

                RectangleD rect = GetPaintRectangle();
                if (rect.Width > 0 && rect.Height > 0 && (e.ClipRectangle.IsEmpty || rect.IntersectsWith(e.ClipRectangle)))
                {
                    #region Fill rectangle
                    if (this.Brush is StiSolidBrush &&
                        ((StiSolidBrush)this.Brush).Color == Color.Transparent &&
                        Report.Info.FillComponent &&
                        IsDesigning)
                    {
                        Color color = Color.FromArgb(150, Color.GreenYellow);

                        StiDrawing.FillRectangle(g, color, rect.Left, rect.Top, rect.Width, rect.Height);
                    }
                    else
                    {
                        StiDrawing.FillRectangle(g, Brush, rect);
                    }
                    #endregion

                    //******************
                    //Draw control
                    //******************

                    #region Markers
                    PaintMarkers(g, rect);
                    #endregion

                    #region Border
                    if (this.HighlightState == StiHighlightState.Hide)
                    {
                        Border.Draw(g, rect, Page.Zoom);
                    }
                    #endregion

                    PaintEvents(e.Graphics, rect);
                }
            }
            e.Cancel = false;
            InvokePainted(this, e);
        }
コード例 #2
0
        public virtual void PaintBackground(MyCustomComponent customComponent, Graphics g, RectangleD rect)
        {
            if (customComponent.Brush is StiSolidBrush &&
                ((StiSolidBrush)customComponent.Brush).Color == Color.Transparent &&
                customComponent.Report.Info.FillComponent &&
                customComponent.IsDesigning)
            {
                Color color = Color.FromArgb(150, Color.White);

                StiDrawing.FillRectangle(g, color, rect.Left, rect.Top, rect.Width, rect.Height);
            }
            else
            {
                StiDrawing.FillRectangle(g, customComponent.Brush, rect);
            }
        }