mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-01 04:30:49 +12:00
Added tile option to "Image" image effect
This commit is contained in:
parent
53d1a3b4e0
commit
8d15f6df63
|
@ -52,6 +52,9 @@ public class DrawImage : ImageEffect
|
||||||
[DefaultValue(typeof(Size), "0, 0")]
|
[DefaultValue(typeof(Size), "0, 0")]
|
||||||
public Size Size { get; set; }
|
public Size Size { get; set; }
|
||||||
|
|
||||||
|
[DefaultValue(false)]
|
||||||
|
public bool Tile { get; set; }
|
||||||
|
|
||||||
[DefaultValue(false), Description("If image watermark size bigger than source image then don't draw it.")]
|
[DefaultValue(false), Description("If image watermark size bigger than source image then don't draw it.")]
|
||||||
public bool AutoHide { get; set; }
|
public bool AutoHide { get; set; }
|
||||||
|
|
||||||
|
@ -135,7 +138,15 @@ public override Bitmap Apply(Bitmap bmp)
|
||||||
g.PixelOffsetMode = PixelOffsetMode.Half;
|
g.PixelOffsetMode = PixelOffsetMode.Half;
|
||||||
g.CompositingMode = CompositingMode;
|
g.CompositingMode = CompositingMode;
|
||||||
|
|
||||||
if (Opacity < 100)
|
if (Tile)
|
||||||
|
{
|
||||||
|
using (TextureBrush brush = new TextureBrush(bmpWatermark, WrapMode.Tile))
|
||||||
|
{
|
||||||
|
brush.TranslateTransform(imageRectangle.X, imageRectangle.Y);
|
||||||
|
g.FillRectangle(brush, imageRectangle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (Opacity < 100)
|
||||||
{
|
{
|
||||||
using (ImageAttributes ia = new ImageAttributes())
|
using (ImageAttributes ia = new ImageAttributes())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue