mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-03 19:54:13 +13:00
Fix OnDrawFinal issues
This commit is contained in:
parent
18cbe0b72c
commit
d3295a412a
3 changed files with 21 additions and 15 deletions
|
@ -77,9 +77,10 @@ public override void OnDrawFinal(Graphics g, Bitmap bmp)
|
||||||
{
|
{
|
||||||
if (BlurRadius > 1)
|
if (BlurRadius > 1)
|
||||||
{
|
{
|
||||||
Rectangle rect = new Rectangle(0, 0, bmp.Width, bmp.Height);
|
Rectangle rect = Rectangle.Intersect(new Rectangle(0, 0, bmp.Width, bmp.Height), Rectangle);
|
||||||
rect.Intersect(Rectangle);
|
|
||||||
|
|
||||||
|
if (!rect.IsEmpty)
|
||||||
|
{
|
||||||
using (Bitmap croppedImage = ImageHelpers.CropBitmap(bmp, rect))
|
using (Bitmap croppedImage = ImageHelpers.CropBitmap(bmp, rect))
|
||||||
{
|
{
|
||||||
ApplyEffect(croppedImage);
|
ApplyEffect(croppedImage);
|
||||||
|
@ -89,4 +90,5 @@ public override void OnDrawFinal(Graphics g, Bitmap bmp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -75,9 +75,10 @@ public override void OnDrawOverlay(Graphics g)
|
||||||
|
|
||||||
public override void OnDrawFinal(Graphics g, Bitmap bmp)
|
public override void OnDrawFinal(Graphics g, Bitmap bmp)
|
||||||
{
|
{
|
||||||
Rectangle rect = new Rectangle(0, 0, bmp.Width, bmp.Height);
|
Rectangle rect = Rectangle.Intersect(new Rectangle(0, 0, bmp.Width, bmp.Height), Rectangle);
|
||||||
rect.Intersect(Rectangle);
|
|
||||||
|
|
||||||
|
if (!rect.IsEmpty)
|
||||||
|
{
|
||||||
using (Bitmap croppedImage = ImageHelpers.CropBitmap(bmp, rect))
|
using (Bitmap croppedImage = ImageHelpers.CropBitmap(bmp, rect))
|
||||||
{
|
{
|
||||||
ApplyEffect(croppedImage);
|
ApplyEffect(croppedImage);
|
||||||
|
@ -86,4 +87,5 @@ public override void OnDrawFinal(Graphics g, Bitmap bmp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -77,9 +77,10 @@ public override void OnDrawFinal(Graphics g, Bitmap bmp)
|
||||||
{
|
{
|
||||||
if (PixelSize > 1)
|
if (PixelSize > 1)
|
||||||
{
|
{
|
||||||
Rectangle rect = new Rectangle(0, 0, bmp.Width, bmp.Height);
|
Rectangle rect = Rectangle.Intersect(new Rectangle(0, 0, bmp.Width, bmp.Height), Rectangle);
|
||||||
rect.Intersect(Rectangle);
|
|
||||||
|
|
||||||
|
if (!rect.IsEmpty)
|
||||||
|
{
|
||||||
using (Bitmap croppedImage = ImageHelpers.CropBitmap(bmp, rect))
|
using (Bitmap croppedImage = ImageHelpers.CropBitmap(bmp, rect))
|
||||||
{
|
{
|
||||||
ApplyEffect(croppedImage);
|
ApplyEffect(croppedImage);
|
||||||
|
@ -89,4 +90,5 @@ public override void OnDrawFinal(Graphics g, Bitmap bmp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue