diff --git a/ShareX.ScreenCaptureLib/Forms/RegionCaptureForm.cs b/ShareX.ScreenCaptureLib/Forms/RegionCaptureForm.cs index 7fb65e8a1..1a174ef98 100644 --- a/ShareX.ScreenCaptureLib/Forms/RegionCaptureForm.cs +++ b/ShareX.ScreenCaptureLib/Forms/RegionCaptureForm.cs @@ -884,6 +884,9 @@ protected override void OnPaint(PaintEventArgs e) Graphics g = e.Graphics; + ShapeManager.CurrentDPI.X = g.DpiX; + ShapeManager.CurrentDPI.Y = g.DpiY; + ZoomTransform(g); if (IsEditorMode && !CanvasRectangle.Contains(ClientArea)) diff --git a/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs b/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs index 8a58b55fc..d1bbd91eb 100644 --- a/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs +++ b/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs @@ -146,6 +146,8 @@ public RectangleF CurrentRectangle } } + public PointF CurrentDPI = new PointF(96f, 96f); + public bool IsCurrentShapeValid => CurrentShape != null && CurrentShape.IsValidShape; public BaseShape[] Regions => Shapes.OfType().ToArray(); @@ -1366,6 +1368,7 @@ public Bitmap RenderOutputImage(Bitmap bmp) public Bitmap RenderOutputImage(Bitmap bmp, PointF offset) { Bitmap bmpOutput = (Bitmap)bmp.Clone(); + bmpOutput.SetResolution(CurrentDPI.X, CurrentDPI.Y); if (DrawingShapes.Length > 0 || EffectShapes.Length > 0) {