Aspose.Imaging for .NET 22.6 - Release notes

Competitive features:

  • Fix issue with rounded corners in rectangle generated in emf file
  • Added support of alternative graphics engine - Aspose.Drawing instead of System.Drawng.Common/GDI+ for .NET Standard 2.0 and higher configurations (available as Aspose.Imaging 22.6 beta)
IMAGINGNET-4786Fix issue with rounded corners in rectangle generated in emf fileFeature
IMAGINGNET-5261Fix bug with exception in CDR fileEnhancement
IMAGINGNET-5214Can’t load DCM imageEnhancement
IMAGINGNET-5177Cannot read DICOM imageEnhancement
IMAGINGNET-4860Can’t load DCM imageEnhancement
IMAGINGNET-4596Cannot load particular ODG imageEnhancement
IMAGINGNET-3595AdjustContrast and AdjustGamma operations are not properly applies on Gif multiframe imageEnhancement

Public API changes:

Added APIs:

Class Aspose.Imaging.CoreExceptions.IncorrectPasswordException

Class Aspose.Imaging.ImageLoadOptions.OdLoadOptions

Method Aspose.Imaging.CoreExceptions.IncorrectPasswordException.#ctor(System.String)

Method Aspose.Imaging.CoreExceptions.IncorrectPasswordException.#ctor (System.String,System.Exception)

Method Aspose.Imaging.FileFormats.OpenDocument.OdgImage.#ctor (Aspose.Imaging.StreamContainer,Aspose.Imaging.LoadOptions)

Method Aspose.Imaging.FileFormats.OpenDocument.OdImage.#ctor (Aspose.Imaging.StreamContainer,Aspose.Imaging.LoadOptions)

Method Aspose.Imaging.FileFormats.OpenDocument.OtgImage.#ctor (Aspose.Imaging.StreamContainer,Aspose.Imaging.LoadOptions)

Method Aspose.Imaging.ImageLoadOptions.OdLoadOptions.#ctor

Property Aspose.Imaging.ImageLoadOptions.OdLoadOptions.Password

Property Aspose.Imaging.ImageOptions.TiffOptions.ExtraSamples

Removed APIs:

Usage Examples:

IMAGINGNET-5261 Fix bug with exception in CDR file

var fileName = @"D:\file.cdr";
var outFileName = fileName + ".png";
using (Image image = Image.Load(fileName))
    image.Save(outFileName, new PngOptions());

IMAGINGNET-5214 Can’t load DCM image

using (var image = Image.Load("file.dcm"))
    image.Save("file-png.png", new PngOptions());

IMAGINGNET-5177 Cannot read DICOM image

using (var image = Image.Load("file.dcm") as DicomImage)
    var pngOptions = new PngOptions()
        ColorType = Png.PngColorType.TruecolorWithAlpha,
        Progressive = true,

    image.Save("file-page-0.png", pngOptions);
    image.Pages[57].Save("file-page-57.png", pngOptions);

IMAGINGNET-4860 Can’t load DCM image

Now provided DICOM sample can be loaded and export to raster format, for example PNG format:

using (var image = Image.Load("file.dcm"))
    image.Save("file-to-png.png", new PngOptions());

IMAGINGNET-4786 Rounded corners in rectangle generated in emf file

string baseFolder = @"D:\";
string file = "result.png";
string outputFileName = Path.Combine(baseFolder, file);
EmfRecorderGraphics2D graphics = new EmfRecorderGraphics2D(
    new Rectangle(0, 0, 1000, 1000),
    new Size(1000, 1000),
    new Size(100, 100));

Pen pen = new Pen(Color.Red, 10);
graphics.DrawRectangle(pen, 10, 10, 80, 80);
pen.LineJoin = LineJoin.Miter;
pen.EndCap = LineCap.Flat;

using (EmfImage image = graphics.EndRecording())
    image.Save(outputFileName, new PngOptions());

IMAGINGNET-4596 Cannot load particular ODG image

using (Image img = Image.Load(@"D:\PasswordProtect.odg", new OdLoadOptions() { Password = "123456789" }))
    img.Save(@"D:\PasswordProtect.odg.png", new PngOptions());

IMAGINGNET-3595 AdjustContrast and AdjustGamma operations are not properly applies on Gif multiframe image

var path = @"D:\earth.gif";

var outputPath = @"D:\earth-contrast.gif";
using (var image = Image.Load(path) as RasterImage)

outputPath = @"D:\earth-gamma.gif";
using (var image = Image.Load(path) as RasterImage)