/// <summary> /// Initializes a new instance of the Direct2DControl class. /// </summary> public Direct2DControl() { this.resizeTimer = new DispatcherTimer(); this.resizeTimer.Interval = ResizeInterval; this.resizeTimer.Tick += this.ResizeTimerTick; this.imageSource = new Direct2D.D3D10Image(); this.imageSource.IsFrontBufferAvailableChanged += OnIsFrontBufferAvailableChanged; this.image = new Image(); this.image.Stretch = Stretch.Fill; // We set this because our resizing isn't immediate this.image.Source = this.imageSource; this.AddVisualChild(this.image); // To greatly reduce flickering we're only going to AddDirtyRect // when WPF is rendering. CompositionTarget.Rendering += this.CompositionTargetRendering; }
/// <summary> /// Initializes a new instance of the Direct2DControl class. /// </summary> public Direct2DControl() { this.resizeTimer = new DispatcherTimer(); this.resizeTimer.Interval = ResizeInterval; this.resizeTimer.Tick += this.ResizeTimerTick; this.imageSource = new D3D10Image(); this.imageSource.IsFrontBufferAvailableChanged += OnIsFrontBufferAvailableChanged; this.image = new Image(); this.image.Stretch = Stretch.Fill; // We set this because our resizing isn't immediate this.image.Source = this.imageSource; this.AddVisualChild(this.image); // To greatly reduce flickering we're only going to AddDirtyRect // when WPF is rendering. CompositionTarget.Rendering += this.CompositionTargetRendering; }