Exemplo n.º 1
0
        //public ZImageButton() : base()
        //{

        //}

        protected override void OnPaint(ZPaintContext context)
        {
            base.OnPaint(context);
            Image image = null;

            if (this.isDown && this.PressImage != null)
            {
                image = this.PressImage;
            }
            else if (this.isHover && this.HoverImage != null)
            {
                image = this.HoverImage;
            }
            else if (this.NormalImage != null)
            {
                image = this.NormalImage;
            }
            else
            {
                return;
            }
            if (this.ImageEdgeInset != Padding.Empty)
            {
                image = ImageApi.ImageStretch(image, this.ImageEdgeInset, this.Size, context.ClipRectangle);
            }

            context.Graphics.DrawImage(image, context.ClipRectangle, new RectangleF(Point.Empty, image.Size), GraphicsUnit.Pixel);
        }
Exemplo n.º 2
0
        protected override void OnPaint(ZPaintContext context)
        {
            base.OnPaint(context);

            context.Graphics.DrawString(this.Text, this.Font, new SolidBrush(this.TextColor), Point.Empty);
        }
Exemplo n.º 3
0
 protected virtual void OnPaint(ZPaintContext context)
 {
     //this.DoLayout();
 }