/* * Initialize */ /// <summary> /// Initializes the designer with the specified component. /// </summary> /// <param name="component">The <see cref="T:System.ComponentModel.IComponent"></see> to associate the designer with. This component must always be an instance of, or derive from, <see cref="T:System.Windows.Forms.Control"></see>.</param> public override void Initialize(IComponent component) { if (component is NuGenPictureBox) { _pictureBox = (NuGenPictureBox)component; } base.Initialize(component); }
/// <summary> /// </summary> /// <param name="disposing"><see langword="true"/> to release both managed and unmanaged resources; <see langword="false"/> to release only unmanaged resources.</param> protected override void Dispose(bool disposing) { if (disposing) { if (_pictureBox != null) { _pictureBox.DisplayModeChanged -= _pictureBox_DisplayModeChanged; _pictureBox.ImageChanged -= _pictureBox_ImageChanged; _pictureBox.ZoomFactorChanged -= _pictureBox_ZoomFactorChanged; _pictureBox.Dispose(); _pictureBox = null; } } base.Dispose(disposing); }
/// <summary> /// Initializes a new instance of the <see cref="NuGenSmoothPictureBox"/> class. /// </summary> /// <param name="serviceProvider"> /// <para>Requires:</para> /// <para><see cref="INuGenControlStateTracker"/></para> /// <para><see cref="INuGenPanelRenderer"/></para> /// <para><see cref="INuGenPictureBoxRenderer"/></para> /// <para><see cref="INuGenSmoothPictureBoxLayoutManager"/></para> /// </param> public NuGenSmoothPictureBox(INuGenServiceProvider serviceProvider) : base(serviceProvider) { this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); this.SetStyle(ControlStyles.ResizeRedraw, true); this.SetStyle(ControlStyles.Selectable, true); this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); this.SetStyle(ControlStyles.UserPaint, true); this.BackColor = Color.Transparent; this.Padding = this.LayoutManager.GetInternalPictureBoxPadding(); _pictureBox = new NuGenPictureBox(serviceProvider); _pictureBox.BackColor = Color.Transparent; _pictureBox.Dock = DockStyle.Fill; _pictureBox.DisplayModeChanged += _pictureBox_DisplayModeChanged; _pictureBox.ImageChanged += _pictureBox_ImageChanged; _pictureBox.ZoomFactorChanged += _pictureBox_ZoomFactorChanged; _pictureBox.Parent = this; }
/// <summary> /// Initializes a new instance of the <see cref="NuGenPictureBoxActionList"/> class. /// </summary> public NuGenPictureBoxActionList(NuGenPictureBox pictureBox) : base(pictureBox) { }