Esempio n. 1
0
        protected override void OnRender(System.Windows.Media.DrawingContext drawingContext)
        {
            Rotary rotary = Visual as Rotary;

            if (rotary != null)
            {
                drawingContext.PushTransform(new RotateTransform(rotary.KnobRotation, _center.X, _center.Y));
                drawingContext.DrawImage(_image, _imageRect);
                drawingContext.Pop();
            }
        }
Esempio n. 2
0
        protected override void OnRefresh()
        {
            Rotary rotary = Visual as Rotary;

            if (rotary != null)
            {
                _imageRect.Width  = rotary.Width;
                _imageRect.Height = rotary.Height;
                _image            = ConfigManager.ImageManager.LoadImage(rotary.KnobImage);
                _brush            = new ImageBrush(_image);
                _center           = new Point(rotary.Width / 2d, rotary.Height / 2d);
            }
            else
            {
                _image = null;
                _brush = null;
            }
        }