SharpDX.Mathematics.Interop.RawPoint offset;
this.Surface = this.SurfaceImageNative.BeginDraw(
new SharpDX.Rectangle(0, 0, (int)this.Size.Width, (int)this.Size.Height), out offset);
+ var prop = new D2D.BitmapProperties1();
+ prop.BitmapOptions = D2D.BitmapOptions.Target | D2D.BitmapOptions.CannotDraw | D2D.BitmapOptions.GdiCompatible;
+ prop.PixelFormat = this._RenderTargetProperties.PixelFormat;
+ prop.DpiX = this._RenderTargetProperties.DpiX;
+ prop.DpiY = this._RenderTargetProperties.DpiY;
this.Bitmap = new D2D.Bitmap1(this.D2DContext, this.Surface, null);
this.D2DContext.Target = this.Bitmap;
this.D2DContext.Transform = Matrix3x2.Translation(offset.X, offset.Y);
rect.Fill = brush;
}
+ D2D.RenderTargetProperties _RenderTargetProperties;
protected override D2D.RenderTarget ConstructRender(D2D.Factory1 factory, D2D.RenderTargetProperties prop, double width, double height)
{
this.D2DDevice = new D2D.Device(factory,this.DXGIDevice);
this.D2DContext = new D2D.DeviceContext(this.D2DDevice, D2D.DeviceContextOptions.None);
+ this._RenderTargetProperties = prop;
return this.D2DContext;
}