mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-01 04:30:49 +12:00
Merge pull request #6548 from L1Q/fix-dpi-changes
Use editor DPI when rendering final image
This commit is contained in:
commit
325df2ea2c
|
@ -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))
|
||||
|
|
|
@ -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<BaseRegionShape>().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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue