public override Bitmap Apply(Bitmap bmp) { using (bmp) { return(ColorMatrixManager.Polaroid().Apply(bmp)); } }
public override Bitmap Apply(Bitmap bmp) { using (bmp) { return(ColorMatrixManager.Alpha(Value, Addition).Apply(bmp)); } }
public override Bitmap Apply(Bitmap bmp) { using (bmp) { return(ColorMatrixManager.Hue(Angle).Apply(bmp)); } }
public override Bitmap Apply(Bitmap bmp) { using (bmp) { return(ColorMatrixManager.Saturation(Value).Apply(bmp)); } }
public override Bitmap Apply(Bitmap bmp) { using (bmp) { return(ColorMatrixManager.Grayscale(Value).Apply(bmp)); } }
public override Bitmap Apply(Bitmap bmp) { using (bmp) { return(ColorMatrixManager.Brightness(Value).Apply(bmp)); } }
public override Bitmap Apply(Bitmap bmp) { using (bmp) { return(ColorMatrixManager.ChangeGamma(bmp, Value)); } }
public override Image Apply(Image img) { using (img) { return(ColorMatrixManager.Saturation(Value).Apply(img)); } }
public override Image Apply(Image img) { using (img) { return(ColorMatrixManager.Polaroid().Apply(img)); } }
/// <summary>Must be called before show form</summary> public virtual void Prepare() { if (SurfaceImage == null) { SurfaceImage = Screenshot.CaptureFullscreen(); } if (Config.UseDimming) { using (Image darkSurfaceImage = ColorMatrixManager.Contrast(0.9f).Apply(SurfaceImage)) { darkBackgroundBrush = new TextureBrush(darkSurfaceImage) { WrapMode = WrapMode.Clamp }; } using (Image lightSurfaceImage = ColorMatrixManager.Contrast(1.1f).Apply(SurfaceImage)) { lightBackgroundBrush = new TextureBrush(lightSurfaceImage) { WrapMode = WrapMode.Clamp }; } } else { darkBackgroundBrush = new TextureBrush(SurfaceImage); } }
public override Image Apply(Image img) { using (img) { return(ColorMatrixManager.Contrast(Value).Apply(img)); } }
public override Image Apply(Image img) { using (img) { return(ColorMatrixManager.Brightness(Value).Apply(img)); } }
public override Image Apply(Image img) { using (img) { return(ColorMatrixManager.Alpha(Value, Addition).Apply(img)); } }
public override Bitmap Apply(Bitmap bmp) { using (bmp) { return(ColorMatrixManager.Colorize(Color, Value).Apply(bmp)); } }
public override Image Apply(Image img) { using (img) { return(ColorMatrixManager.Hue(Angle).Apply(img)); } }
public override Image Apply(Image img) { using (img) { return(ColorMatrixManager.ChangeGamma(img, Value)); } }
public override Image Apply(Image img) { using (img) { return(ColorMatrixManager.Grayscale(Value).Apply(img)); } }
public override Image Apply(Image img) { using (img) { return(ColorMatrixManager.BlackWhite().Apply(img)); } }
public override Bitmap Apply(Bitmap bmp) { using (bmp) { return(ColorMatrixManager.BlackWhite().Apply(bmp)); } }
/// <summary>Must be called before show form</summary> public virtual void Prepare() { if (SurfaceImage == null) { SurfaceImage = Screenshot.CaptureFullscreen(); } using (Image darkSurfaceImage = ColorMatrixManager.Contrast(0.8f).Apply(SurfaceImage)) { darkBackgroundBrush = new TextureBrush(darkSurfaceImage); } using (Image lightSurfaceImage = ColorMatrixManager.Contrast(1.1f).Apply(SurfaceImage)) { lightBackgroundBrush = new TextureBrush(lightSurfaceImage); } }
public override Bitmap Apply(Bitmap bmp) { if (Opacity < 1 || (SizeMode != DrawImageSizeMode.DontResize && Size.Width <= 0 && Size.Height <= 0)) { return(bmp); } string imageFilePath = Helpers.ExpandFolderVariables(ImageLocation, true); if (!string.IsNullOrEmpty(imageFilePath) && File.Exists(imageFilePath)) { using (Bitmap bmpWatermark = ImageHelpers.LoadImage(imageFilePath)) { if (bmpWatermark != null) { if (RotateFlip != ImageRotateFlipType.None) { bmpWatermark.RotateFlip((RotateFlipType)RotateFlip); } Size imageSize; if (SizeMode == DrawImageSizeMode.AbsoluteSize) { int width = Size.Width == -1 ? bmp.Width : Size.Width; int height = Size.Height == -1 ? bmp.Height : Size.Height; imageSize = ImageHelpers.ApplyAspectRatio(width, height, bmpWatermark); } else if (SizeMode == DrawImageSizeMode.PercentageOfWatermark) { int width = (int)Math.Round(Size.Width / 100f * bmpWatermark.Width); int height = (int)Math.Round(Size.Height / 100f * bmpWatermark.Height); imageSize = ImageHelpers.ApplyAspectRatio(width, height, bmpWatermark); } else if (SizeMode == DrawImageSizeMode.PercentageOfCanvas) { int width = (int)Math.Round(Size.Width / 100f * bmp.Width); int height = (int)Math.Round(Size.Height / 100f * bmp.Height); imageSize = ImageHelpers.ApplyAspectRatio(width, height, bmpWatermark); } else { imageSize = bmpWatermark.Size; } Point imagePosition = Helpers.GetPosition(Placement, Offset, bmp.Size, imageSize); Rectangle imageRectangle = new Rectangle(imagePosition, imageSize); if (AutoHide && !new Rectangle(0, 0, bmp.Width, bmp.Height).Contains(imageRectangle)) { return(bmp); } using (Graphics g = Graphics.FromImage(bmp)) { g.InterpolationMode = ImageHelpers.GetInterpolationMode(InterpolationMode); g.PixelOffsetMode = PixelOffsetMode.Half; g.CompositingMode = CompositingMode; 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()) { ColorMatrix matrix = ColorMatrixManager.Alpha(Opacity / 100f); ia.SetColorMatrix(matrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap); g.DrawImage(bmpWatermark, imageRectangle, 0, 0, bmpWatermark.Width, bmpWatermark.Height, GraphicsUnit.Pixel, ia); } } else { g.DrawImage(bmpWatermark, imageRectangle); } } } } } return(bmp); }