Aspose.Imaging for .NET图片处理控件发布了新的3.6版本

作者:控件中国网   出处:控件中国网   2016-06-13 10:36:36   阅读:7

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
using (var image = (Aspose.Imaging.FileFormats.Emf.EmfImage)Aspose.Imaging.Image.Load(filePath))
{
    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 });
}
2.在新的版本中开发人员可以利用Aspose.Imaging控件提供的API进行PSD文件的图层合并
string sourceFileName = "5_layers.psd";
//Load an existing PSD file as image
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(sourceFileName))
{
       // Convert the loaded image to PSDImage
       var psdImage = (Aspose.Imaging.FileFormats.Psd.PsdImage)image;
 
       // 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.
            jpgOptions.Source = new Aspose.Imaging.Sources.StreamSource(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.对呈现源文件时的缓存处理进行了增强
Copyright© 2006-2015 ComponentCN.com all rights reserved.重庆磐岩科技有限公司(控件中国网) 版权所有 渝ICP备12000264号 法律顾问:元炳律师事务所
客服软件
live chat