Quantcast
Channel: magick Discussions Rss Feed
Viewing all articles
Browse latest Browse all 3693

New Post: Cropping

$
0
0
Here is simple example. I probably just missed something, but when I create a clone and crop it afterwards, it is OK. When I use the Clone method with parameters, the image properties (colorspace, depth, etc.) are not cloned.
Bitmap bmp = new Bitmap(4, 4);            
using (var image = new MagickImage(bmp))
{
  image.Format = MagickFormat.Rgba;
  Console.WriteLine(image.ToByteArray().Length); // output: 64// okvar clone = image.Clone();
  clone.Crop(0, 0, 2, 2);
  Console.WriteLine(clone.ToByteArray().Length); // output: 16// failvar croppedclone = image.Clone(0, 0, 2, 2);
  Console.WriteLine(croppedclone.ToByteArray().Length);  // null reference 
}
pet

Viewing all articles
Browse latest Browse all 3693

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>