mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
Merge pull request #6548 from L1Q/fix-dpi-changes
Use editor DPI when rendering final image
This commit is contained in:
commit
325df2ea2c
2 changed files with 6 additions and 0 deletions
|
@ -884,6 +884,9 @@ protected override void OnPaint(PaintEventArgs e)
|
||||||
|
|
||||||
Graphics g = e.Graphics;
|
Graphics g = e.Graphics;
|
||||||
|
|
||||||
|
ShapeManager.CurrentDPI.X = g.DpiX;
|
||||||
|
ShapeManager.CurrentDPI.Y = g.DpiY;
|
||||||
|
|
||||||
ZoomTransform(g);
|
ZoomTransform(g);
|
||||||
|
|
||||||
if (IsEditorMode && !CanvasRectangle.Contains(ClientArea))
|
if (IsEditorMode && !CanvasRectangle.Contains(ClientArea))
|
||||||
|
|
|
@ -146,6 +146,8 @@ public RectangleF CurrentRectangle
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PointF CurrentDPI = new PointF(96f, 96f);
|
||||||
|
|
||||||
public bool IsCurrentShapeValid => CurrentShape != null && CurrentShape.IsValidShape;
|
public bool IsCurrentShapeValid => CurrentShape != null && CurrentShape.IsValidShape;
|
||||||
|
|
||||||
public BaseShape[] Regions => Shapes.OfType<BaseRegionShape>().ToArray();
|
public BaseShape[] Regions => Shapes.OfType<BaseRegionShape>().ToArray();
|
||||||
|
@ -1366,6 +1368,7 @@ public Bitmap RenderOutputImage(Bitmap bmp)
|
||||||
public Bitmap RenderOutputImage(Bitmap bmp, PointF offset)
|
public Bitmap RenderOutputImage(Bitmap bmp, PointF offset)
|
||||||
{
|
{
|
||||||
Bitmap bmpOutput = (Bitmap)bmp.Clone();
|
Bitmap bmpOutput = (Bitmap)bmp.Clone();
|
||||||
|
bmpOutput.SetResolution(CurrentDPI.X, CurrentDPI.Y);
|
||||||
|
|
||||||
if (DrawingShapes.Length > 0 || EffectShapes.Length > 0)
|
if (DrawingShapes.Length > 0 || EffectShapes.Length > 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue