mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-15 11:26:36 +12:00
In editor mode center image to active monitor
This commit is contained in:
parent
6ad4f18373
commit
30ee623852
|
@ -160,7 +160,14 @@ public void Prepare(Image img)
|
||||||
|
|
||||||
if (Mode == RegionCaptureMode.Editor)
|
if (Mode == RegionCaptureMode.Editor)
|
||||||
{
|
{
|
||||||
ImageRectangle = new Rectangle(ScreenRectangle.Width / 2 - Image.Width / 2, ScreenRectangle.Height / 2 - Image.Height / 2, Image.Width, Image.Height);
|
Rectangle rect = CaptureHelpers.GetActiveScreenBounds0Based();
|
||||||
|
|
||||||
|
if (Image.Width > rect.Width || Image.Height > rect.Height)
|
||||||
|
{
|
||||||
|
rect = ScreenRectangle0Based;
|
||||||
|
}
|
||||||
|
|
||||||
|
ImageRectangle = new Rectangle(rect.X + rect.Width / 2 - Image.Width / 2, rect.Y + rect.Height / 2 - Image.Height / 2, Image.Width, Image.Height);
|
||||||
|
|
||||||
using (Image background = ImageHelpers.DrawCheckers(ScreenRectangle0Based.Width, ScreenRectangle0Based.Height))
|
using (Image background = ImageHelpers.DrawCheckers(ScreenRectangle0Based.Width, ScreenRectangle0Based.Height))
|
||||||
using (Graphics g = Graphics.FromImage(background))
|
using (Graphics g = Graphics.FromImage(background))
|
||||||
|
|
Loading…
Reference in a new issue