Aspose.Imaging for .NET图片处理控件发布了新的3.6版本,在该新版本中添加了多个新的功能和对以往产品中存在的部分BUG进行了修复,具体可以参考下面的详细信息:
1.在新的版本中导出EMF和EMF+源文件为光栅格式的图片
string filePath = "TestEmfBezier.emf";
// Create EmfRasterizationOption class instance and set properties
EmfRasterizationOptions emfRasterizationOptions = new EmfRasterizationOptions();
emfRasterizationOptions.BackgroundColor =
Aspose.Imaging.Color.PapayaWhip;
emfRasterizationOptions.PageWidth = 300;
emfRasterizationOptions.PageHeight = 300;
// Load an existing EMF file as iamge and convert it to EmfImage class object
{
if (!image.Header.EmfHeader.Valid)
{
throw new
Aspose.Imaging.CoreExceptions.ImageLoadException(string.Format("The file {0} is not valid", filePath));
}
// Convert EMF to BMP
image.Save(filePath + ".bmp", new BmpOptions() { VectorRasterizationOptions = emfRasterizationOptions });
// Convert EMF to GIF
image.Save(filePath + ".gif", new GifOptions() { VectorRasterizationOptions = emfRasterizationOptions });
// Convert EMF to JPEG
image.Save(filePath + ".jpeg", new JpegOptions() { VectorRasterizationOptions = emfRasterizationOptions });
// Convert EMF to J2K
image.Save(filePath + ".j2k", new Jpeg2000Options() { VectorRasterizationOptions = emfRasterizationOptions });
// Convert EMF to PNG
image.Save(filePath + ".png", new PngOptions() { VectorRasterizationOptions = emfRasterizationOptions });
// Convert EMF to PSD
image.Save(filePath + ".psd", new PsdOptions() { VectorRasterizationOptions = emfRasterizationOptions });
// Convert EMF to TIFF
image.Save(filePath + ".tiff", new TiffOptions(TiffExpectedFormat.TiffLzwRgb) { VectorRasterizationOptions =
emfRasterizationOptions });
// Convert EMF to WebP
image.Save(filePath + ".webp", new WebPOptions() { VectorRasterizationOptions = emfRasterizationOptions });
}
string sourceFileName = "5_layers.psd";
//Load an existing PSD file as image
{
// Convert the loaded image to PSDImage
// create a JPG file stream
using (Stream stream = File.Create(sourceFileName.Replace("psd", "jpg")))
{
// Create JPEG option class object
var jpgOptions = new JpegOptions();
// Set the source property to jpg file stream.
// call the Save the method of PSDImage class to merge the layers and save it as jpg image.
psdImage.Save(stream, jpgOptions);
}
}
3.对转换PSD文件为TIFF的处理进行了增强
4.对呈现源文件时的缓存处理进行了增强