Пример #1
0
        public override void DrawContents()
        {
            base.DrawContents();
            if (Image != null)
            {
                var origonalTransform = Image.ColorTransform;

                ColorTransform effectTranform = ColorTransform.Identity;

                if (IsMouseOver)
                {
                    effectTranform = ColorTransform.Multiply(new Color(1.3f, 1.3f, 1.2f));
                }
                if (Depressed)
                {
                    effectTranform = ColorTransform.Multiply(new Color(0.8f, 0.8f, 0.8f));
                }
                if (!Enabled)
                {
                    effectTranform = ColorTransform.BlackAndWhite;
                }

                if (!effectTranform.IsIdentity)
                {
                    Image.ColorTransform = Image.ColorTransform + effectTranform;
                }

                Image.Update();
                Image.Draw();

                Image.ColorTransform = origonalTransform;
            }
        }
Пример #2
0
 public override void DrawContents()
 {
     base.DrawContents();
     Image.Draw();
     if (Label.Visible)
     {
         Label.Draw();
     }
 }