//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); }
protected override void OnPaint(ZPaintContext context) { base.OnPaint(context); context.Graphics.DrawString(this.Text, this.Font, new SolidBrush(this.TextColor), Point.Empty); }
protected virtual void OnPaint(ZPaintContext context) { //this.DoLayout(); }