/// <summary> A MagickWand extension method that overlay image. </summary> /// <param name="wand"> The wand to act on. </param> /// <param name="compose"> The compose. </param> /// <param name="x"> The x coordinate. </param> /// <param name="y"> The y coordinate. </param> /// <param name="width"> The width. </param> /// <param name="height"> The height. </param> /// <param name="magickwand"> The magickwand. </param> internal static void OverlayImage(this ImageWand wand, CompositeOperator compose, double x, double y, double width, double height, MagickWand magickwand) { using (var draw = new DrawingWand()) { draw.DrawComposite(compose, x, y, width, height, magickwand.CurrentImage); wand.DrawImage(draw); } }
/// <summary> A MagickWand extension method that cover art stack. </summary> /// <param name="wand"> The wand. </param> /// <param name="xIncrement"> Amount to increment by. </param> /// <param name="yIncrement"> Amount to increment by. </param> /// <param name="width"> The width. </param> /// <param name="height"> The height. </param> /// <param name="images"> A variable-length parameters list containing images. </param> private static void CoverArtStack(this MagickWand wand, double xIncrement, double yIncrement, double width, double height, params string[] images) { using (var draw = new DrawingWand()) { double x = 0; double y = 0; using (var wandimages = new MagickWand(images)) { foreach (ImageWand imageWand in wandimages.ImageList) { using (var blackPixelWand = new PixelWand("black")) { imageWand.BorderImage(blackPixelWand, 2, 2); draw.DrawComposite(CompositeOperator.AtopCompositeOp, x, y, width, height, imageWand); x += xIncrement; y += yIncrement; } } } wand.CurrentImage.DrawImage(draw); } }
/// <summary> A MagickWand extension method that cover art stack. </summary> /// <param name="wand"> The wand. </param> /// <param name="xIncrement"> Amount to increment by. </param> /// <param name="yIncrement"> Amount to increment by. </param> /// <param name="width"> The width. </param> /// <param name="height"> The height. </param> /// <param name="images"> A variable-length parameters list containing images. </param> private static void CoverArtStack(this MagickWand wand, double xIncrement, double yIncrement, double width, double height, params string[] images) { using (var draw = new DrawingWand()) { double x = 0; double y = 0; using (var wandimages = new MagickWand(images)) { foreach (ImageWand imageWand in wandimages.ImageList) { using (var blackPixelWand = new PixelWand("black")) { imageWand.BorderImage(blackPixelWand, 2, 2); draw.DrawComposite(CompositeOperator.AtopCompositeOp, x, y, width, height, imageWand); x += xIncrement; y += yIncrement; } } } wand.CurrentImage.DrawImage(draw); } }
/// <summary> A MagickWand extension method that overlay image. </summary> /// <param name="wand"> The wand to act on. </param> /// <param name="compose"> The compose. </param> /// <param name="x"> The x coordinate. </param> /// <param name="y"> The y coordinate. </param> /// <param name="width"> The width. </param> /// <param name="height"> The height. </param> /// <param name="magickwand"> The magickwand. </param> internal static void OverlayImage(this ImageWand wand, CompositeOperator compose, double x, double y, double width, double height, MagickWand magickwand) { using (var draw = new DrawingWand()) { draw.DrawComposite(compose, x, y, width, height, magickwand.CurrentImage); wand.DrawImage(draw); } }