예제 #1
0
        /// <summary>
        /// Custom painting
        /// </summary>
        /// <param name="e"></param>
        protected override void OnPaint(PaintEventArgs e)
        {
            GlassHelper.FillRectangle(this.ClientRectangle, GlassStyleManager.Active.Panel, false, GlassStyleManager.Active.PanelIsGlass, e.Graphics);

            GlassHelper.DrawBorder(this.ClientRectangle, GlassBorders.Top | GlassBorders.TopAndBottom, e.Graphics);

            Color alphaFore   = Color.FromArgb(this.transitionAlpha, this.currentMessage.Color);
            Color alphaShadow = Color.FromArgb(this.transitionAlpha, Color.Black);

            Rectangle textRectangle = this.ClientRectangle;

            //textRectangle.Inflate(-2, -2);

            //if(this.currentMessage.Image != null)
            //{
            //    int top = 0;

            //    top = (this.Height/2) - (this.currentMessage.Image.Height/2);

            //    e.Graphics.DrawImage(this.currentMessage.Image, 2, top );

            //    textRectangle.Offset(4 + this.currentMessage.Image.Width, 0);
            //    textRectangle.Inflate(-(4 + this.currentMessage.Image.Width), 0);
            //}

            GlassHelper.DrawText(this.currentMessage.Text, textRectangle, ContentAlignment.MiddleCenter, e.Graphics, true, alphaFore, alphaShadow);
        }
예제 #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="e"></param>
 protected override void OnPaint(PaintEventArgs e)
 {
     base.OnPaint(e);
     GlassHelper.DrawBorder(this.ClientRectangle, GlassBorders.All, e.Graphics);
 }