/// <summary> /// Initialzes a new <see cref="SurfaceImageSourceTarget"/> instance. /// </summary> /// <param name="pixelWidth">Width of the target in pixels</param> /// <param name="pixelHeight">Height of the target in pixels</param> public SurfaceImageSourceTarget(int pixelWidth, int pixelHeight, bool supportOpacity = false) { this.pixelWidth = pixelWidth; this.pixelHeight = pixelHeight; this.surfaceImageSource = new SurfaceImageSource(pixelWidth, pixelHeight, supportOpacity); surfaceImageSourceNative = Collect(ComObject.As<SharpDX.DXGI.ISurfaceImageSourceNative>(surfaceImageSource)); }
/// <summary> /// Initialzes a new <see cref="SurfaceImageSourceTarget"/> instance. /// </summary> /// <param name="pixelWidth">Width of the target in pixels</param> /// <param name="pixelHeight">Height of the target in pixels</param> public SurfaceImageSourceTarget(int pixelWidth, int pixelHeight, bool supportOpacity = false) { this.pixelWidth = pixelWidth; this.pixelHeight = pixelHeight; this.surfaceImageSource = new SurfaceImageSource(pixelWidth, pixelHeight, supportOpacity); surfaceImageSourceNative = Collect(ComObject.As <SharpDX.DXGI.ISurfaceImageSourceNative>(surfaceImageSource)); }
/// <summary> /// Initialzes a new <see cref="SurfaceImageSourceTarget"/> instance. /// </summary> /// <param name="pixelWidth">Width of the target in pixels</param> /// <param name="pixelHeight">Height of the target in pixels</param> public SurfaceImageSourceTarget(int pixelWidth, int pixelHeight) { this.pixelWidth = pixelWidth; this.pixelHeight = pixelHeight; this.surfaceImageSource = new SurfaceImageSource(pixelWidth, pixelHeight); surfaceImageSourceNative = ComObject.As<SharpDX.DXGI.ISurfaceImageSourceNative>(surfaceImageSource); }
/// <summary> /// Initialzes a new <see cref="SurfaceImageSourceTarget"/> instance. /// </summary> /// <param name="pixelWidth">Width of the target in pixels</param> /// <param name="pixelHeight">Height of the target in pixels</param> public SurfaceImageSourceTarget(int pixelWidth, int pixelHeight) { this.pixelWidth = pixelWidth; this.pixelHeight = pixelHeight; this.surfaceImageSource = new SurfaceImageSource(pixelWidth, pixelHeight); surfaceImageSourceNative = ComObject.As <SharpDX.DXGI.ISurfaceImageSourceNative>(surfaceImageSource); }
/// <summary> /// Initialzes a new <see cref="SurfaceImageSourceTarget"/> instance. /// </summary> /// <param name="pixelWidth">Width of the target in pixels</param> /// <param name="pixelHeight">Height of the target in pixels</param> public SurfaceImageSourceTarget(int pixelWidth, int pixelHeight, bool supportOpacity = false) { this.pixelWidth = pixelWidth; this.pixelHeight = pixelHeight; this.surfaceImageSource = new SurfaceImageSource(pixelWidth, pixelHeight, supportOpacity); surfaceImageSourceNative = ToDispose(ComObject.As<SharpDX.DXGI.ISurfaceImageSourceNative>(surfaceImageSource)); viewDatas[0] = new SurfaceViewData(); viewDatas[1] = new SurfaceViewData(); }
/// <summary> /// Initialzes a new <see cref="SurfaceImageSourceTarget"/> instance. /// </summary> /// <param name="pixelWidth">Width of the target in pixels</param> /// <param name="pixelHeight">Height of the target in pixels</param> public SurfaceImageSourceTarget(int pixelWidth, int pixelHeight, bool supportOpacity = false) { this.pixelWidth = pixelWidth; this.pixelHeight = pixelHeight; this.surfaceImageSource = new SurfaceImageSource(pixelWidth, pixelHeight, supportOpacity); surfaceImageSourceNative = ToDispose(ComObject.As <SharpDX.DXGI.ISurfaceImageSourceNative>(surfaceImageSource)); viewDatas[0] = new SurfaceViewData(); viewDatas[1] = new SurfaceViewData(); }
/// <summary> /// Initializes a new <see cref="SurfaceImageSourceTarget" /> instance. /// </summary> /// <param name="pixelWidth">Width of the target in pixels</param> /// <param name="pixelHeight">Height of the target in pixels</param> public SurfaceImageSourceTarget(int pixelWidth, int pixelHeight, bool supportOpacity = false) { this._pixelWidth = pixelWidth; this._pixelHeight = pixelHeight; _surfaceImageSource = new SurfaceImageSource(pixelWidth, pixelHeight, supportOpacity); _surfaceImageSourceNative = Collect(ComObject.As <ISurfaceImageSourceNative>(_surfaceImageSource)); _viewDatas[0] = Collect(new SurfaceViewData()); _viewDatas[1] = Collect(new SurfaceViewData()); }
/// <summary> /// Initialzes a new <see cref="SurfaceImageSourceTarget"/> instance. /// </summary> /// <param name="pixelWidth">Width of the target in pixels</param> /// <param name="pixelHeight">Height of the target in pixels</param> /// <param name="isOpaque">Indicates whether the surface is expected to be always opaque (without transparency support).</param> public SurfaceImageSourceTarget(int pixelWidth, int pixelHeight, bool isOpaque = false) { this.pixelWidth = pixelWidth; this.pixelHeight = pixelHeight; this.surfaceImageSource = new SurfaceImageSource(pixelWidth, pixelHeight, isOpaque); surfaceImageSourceNative = ComObject.As<SharpDX.DXGI.ISurfaceImageSourceNative>(surfaceImageSource); viewDatas[0] = new SurfaceViewData(); viewDatas[1] = new SurfaceViewData(); }
/// <summary> /// Initialzes a new <see cref="SurfaceImageSourceTarget"/> instance. /// </summary> /// <param name="pixelWidth">Width of the target in pixels</param> /// <param name="pixelHeight">Height of the target in pixels</param> /// <param name="isOpaque">Indicates whether the surface is expected to be always opaque (without transparency support).</param> public SurfaceImageSourceTarget(int pixelWidth, int pixelHeight, bool isOpaque = false) { this.pixelWidth = pixelWidth; this.pixelHeight = pixelHeight; this.surfaceImageSource = new SurfaceImageSource(pixelWidth, pixelHeight, isOpaque); surfaceImageSourceNative = ComObject.As <SharpDX.DXGI.ISurfaceImageSourceNative>(surfaceImageSource); viewDatas[0] = new SurfaceViewData(); viewDatas[1] = new SurfaceViewData(); }
protected override void Dispose(bool disposeManagedResources) { this.surfaceImageSource = null; if (surfaceImageSourceNative != null) { surfaceImageSourceNative.Dispose(); surfaceImageSourceNative = null; } for (int i = 0; i < viewDatas.Length; i++) { viewDatas[i].Dispose(); viewDatas[i] = null; } base.Dispose(disposeManagedResources); }