wndlessimage.cs

来自「破解的飞信源代码」· CS 代码 · 共 63 行

CS
63
字号
namespace Imps.Client.Pc.BizControls
{
    using Imps.Client.Pc;
    using System;
    using System.Drawing;

    public class WndlessImage : XFormWndlessControl
    {
        protected System.Drawing.Image _image;
        private Color _transColor;

        public override void Dispose()
        {
            this._image.Dispose();
        }

        public override void MouseDblClick(EventArgs e)
        {
            if (base.Visible)
            {
                base.RaiseDoubleClick(base._parent, e);
            }
        }

        public override void OnPaint(Graphics g, Rectangle clipRectangle)
        {
            if (base.Visible)
            {
                Rectangle rect = base.Rectangle;
                if (clipRectangle.IntersectsWith(rect) && (this._image != null))
                {
                    DrawHelper.DrawImage(g, this._image, rect, this.TransColor);
                }
            }
        }

        public System.Drawing.Image Image
        {
            get
            {
                return this._image;
            }
            set
            {
                this._image = (System.Drawing.Image) value.Clone();
            }
        }

        public Color TransColor
        {
            get
            {
                return this._transColor;
            }
            set
            {
                this._transColor = value;
            }
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?