public override void GetDpi(out float dpix, out float dpiy)
{
- dpix = DisplayInformation.GetForCurrentView().LogicalDpi;
- dpiy = DisplayInformation.GetForCurrentView().LogicalDpi;
+ Util.GetDpi(out dpix, out dpiy);
}
public bool Resize(Windows.UI.Xaml.Shapes.Rectangle rect, double width, double height)
return this.Size.Height != 0 && this.Size.Width != 0;
}
- public override void BegineDraw()
+ public void DrawContent(EditView view,bool IsEnabled,Rectangle updateRect)
{
- SharpDX.Point offset;
+ 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);
float dpix, dpiy;
dpix, dpiy, D2D.BitmapOptions.Target | D2D.BitmapOptions.CannotDraw);
this.Bitmap = new D2D.Bitmap1(this.D2DContext, this.Surface, prop);
this.D2DContext.Target = this.Bitmap;
- this.D2DContext.Transform = Matrix3x2.Translation(offset.X,offset.Y);
+ this.D2DContext.Transform = Matrix3x2.Translation(offset.X, offset.Y);
base.BegineDraw();
- }
- public override void EndDraw()
- {
+ if (IsEnabled)
+ view.Draw(updateRect);
+ else
+ this.FillBackground(updateRect);
+
base.EndDraw();
this.Surface.Dispose();
this.Bitmap.Dispose();