Improved Handling of Rectangle’s Rounded Corners
In this release of the API we have fixed the issue with 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());
}
This image processing API release has fixed bugs with exception in CDR
file handling as well as a scenario where the developers could not read the DICOM
image.
var fileName = @"D:\file.cdr";
var outFileName = fileName + ".png";
using (Image image = Image.Load(fileName))
{
image.Save(outFileName, new PngOptions());
}
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);
}
Contrast & Gamma Support for GIF Multi Frame Image
Previously, AdjustContrast
and AdjustGamma
operations were not being properly applied on GIF
multi frame image. Both have been resolved in this release.
var path = @"D:\earth.gif";
var outputPath = @"D:\earth-contrast.gif";
using (var image = Image.Load(path) as RasterImage)
{
image.AdjustContrast(40);
image.Save(outputPath);
}
outputPath = @"D:\earth-gamma.gif";
using (var image = Image.Load(path) as RasterImage)
{
image.AdjustGamma(3.5f);
image.Save(outputPath);
}
For a complete list of features, enhancements, and bug fixes in this release please visit, Aspose.Imaging for .NET 22.6.