Class ImageRotarySkin
- Namespace
- PluginUI
- Assembly
- PluginUI.dll
Bitmap knob made of a single rotor image rotated with the value (iPlug2 IBKnobRotaterControl), with an
optional static background (scale, shadow) and foreground (highlights, glass). Lighter than a film-strip: one image
instead of 64–128 frames, at the cost of rotating the lighting with the knob.
public sealed class ImageRotarySkin : IControlSkin
- Inheritance
-
ImageRotarySkin
- Implements
- Inherited Members
Examples
var rotor = ImageSource.FromFile("knob-rotor@2x.png", pixelsPerDip: 2f);
var knob = new Knob(parameter) { Skin = new ImageRotarySkin(rotor) { MinAngle = -150f, MaxAngle = 150f } };
Remarks
Provide the rotor at 2× (and pixelsPerDip: 2) for sharp HiDPI rendering; it is drawn with smoothing.
Constructors
ImageRotarySkin(ImageSource, ImageSource?, ImageSource?)
Bitmap knob made of a single rotor image rotated with the value (iPlug2 IBKnobRotaterControl), with an
optional static background (scale, shadow) and foreground (highlights, glass). Lighter than a film-strip: one image
instead of 64–128 frames, at the cost of rotating the lighting with the knob.
public ImageRotarySkin(ImageSource rotor, ImageSource? background = null, ImageSource? foreground = null)
Parameters
rotorImageSourcebackgroundImageSourceforegroundImageSource
Examples
var rotor = ImageSource.FromFile("knob-rotor@2x.png", pixelsPerDip: 2f);
var knob = new Knob(parameter) { Skin = new ImageRotarySkin(rotor) { MinAngle = -150f, MaxAngle = 150f } };
Remarks
Provide the rotor at 2× (and pixelsPerDip: 2) for sharp HiDPI rendering; it is drawn with smoothing.
Properties
Fit
How the images are fitted into the widget area (default: contained, aspect preserved).
public ImageFit Fit { get; init; }
Property Value
MaxAngle
Angle at value 1.
public float MaxAngle { get; init; }
Property Value
MinAngle
Angle at value 0 (degrees, clockwise from 12 o'clock).
public float MinAngle { get; init; }
Property Value
Methods
Render(DrawingContext, Control, in SkinState)
Draws the control for the given state.
public void Render(DrawingContext dc, Control control, in SkinState state)
Parameters
dcDrawingContextcontrolControlstateSkinState