public MagickImage(MagickImage image) { ImageMagick.EnsureInitialized(); this.Handle = ImageMagick.CloneMagickWand(image.Handle); if (this.Handle == IntPtr.Zero) { throw new ImageMagickException(image.Handle); } }
public static byte[] CreateThumbnail(byte[] source, int size, out string extension, out string mimeType) { MagickImage image = new MagickImage(source); int newSize = Math.Min(image.Width, image.Height); int x = (image.Width - newSize) / 2; int y = (image.Height - newSize) / 2; image.Crop(newSize, newSize, x, y); image.Resize(size, size, FilterType.CubicFilter, 1); extension = ".jpeg"; mimeType = "image/jpeg"; image.Format = "JPEG"; return image.GetBlob(); }
public Image(int width, int height, MagickPixelWand pixelWand) { this.image = new MagickImage(width, height, pixelWand); }
/// <summary> /// Creates a new Image instance using the same image as passed. /// </summary> public Image(MagickImage image) { this.image = image; }
/// <summary> /// Copies the image into a new one. /// </summary> public Image(Image image) { this.image = new MagickImage(image.image); }
public Image(byte[] blob) { this.image = new MagickImage(blob); }
public Image(string path) { this.image = new MagickImage(path); }
public void Dispose() { this.image.Dispose(); this.image = null; }
public void CompositeImage(MagickImage sourceImage, CompositeOperator compose, int x, int y) { this.ExecuteChecked(ImageMagick.MagickCompositeImage, sourceImage.Handle, (int)compose, x, y); }