Beispiel #1
0
        public void EncodeImageJpg()
        {
            // Crop a slightly different interior region of the same size and verify that the data is different (as a sanity check)
            EncodedImage encImg = new EncodedImage();

            encImg.EncodeFrom(this.testImage, new JpegBitmapEncoder());
            Image target = new Image(this.testImage.Width, this.testImage.Height, this.testImage.Stride, this.testImage.PixelFormat);

            encImg.DecodeTo(target);
            Image target2 = new Image(this.testImage.Width, this.testImage.Height, this.testImage.Stride, this.testImage.PixelFormat);

            encImg.DecodeTo(target2);
            this.AssertAreImagesEqual(target, target2);
        }