提供3000多款全球软件/控件产品
针对软件研发的各个阶段提供专业培训与技术咨询
根据客户需求提供定制化的软件开发服务
全球知名设计软件,显著提升设计质量
打造以经营为中心,实现生产过程透明化管理
帮助企业合理产能分配,提高资源利用率
快速打造数字化生产线,实现全流程追溯
生产过程精准追溯,满足企业合规要求
以六西格玛为理论基础,实现产品质量全数字化管理
通过大屏电子看板,实现车间透明化管理
对设备进行全生命周期管理,提高设备综合利用率
实现设备数据的实时采集与监控
利用数字化技术提升油气勘探的效率和成功率
钻井计划优化、实时监控和风险评估
提供业务洞察与决策支持实现数据驱动决策
原创|产品更新|编辑:李显亮|2020-02-27 10:39:40.057|阅读 143 次
概述:在Aspose.Imaging for .NET v20.2中,支持TIFF格式的不同栅格数据类型,优化Tiff和Gif格式的速度或内存,添加矢量和多页图像的新类,修复多项格式转换时发生的异常,接下来我们用示例演示新增的功能。
# 慧都年终大促·界面/图表报表/文档/IDE等千款热门软控件火热促销中 >>
Aspose.Imaging for .NET一种高级图像处理控件,允许开发人员创建,编辑,绘制或转换图像。图像导出和转换是API核心功能之一,它允许在不安装Photoshop应用程序或任何其他图像编辑器的情况下保存为AdobePhotoshop®本机格式。
在Aspose.Imaging for .NET v20.2中,支持TIFF格式的不同栅格数据类型,优化Tiff和Gif格式的速度或内存,添加矢量和多页图像的新类,修复多项格式转换时发生的异常,接下来我们用示例演示新增的功能。
>>欢迎下载Aspose.Imaging for .NET v20.2体验
key | 概述 | 类别 |
---|---|---|
IMAGINGNET-3624 | 支持TIFF格式的不同栅格数据类型 | 功能 |
IMAGINGNET-3588 | 将TIFF转换为PNG的异常 | 功能 |
IMAGINGNET-3409 | 允许针对Tiff格式的速度或内存优化策略 | 功能 |
IMAGINGNET-3408 | 允许针对Gif格式的速度或内存优化策略 | 功能 |
IMAGINGNET-3364 | 统一处理多页图像导出 | 功能 |
IMAGINGNET-2548 | 介绍矢量和多页图像的新类 | 功能 |
IMAGINGNET-3633 | 将Tiff图片转换为PNG的异常 | 增强功能 |
IMAGINGNET-3632 | 将jpeg转换为pdf的异常 | 增强功能 |
IMAGINGNET-3631 | 将JPG转换为PDF时的异常 | 增强功能 |
IMAGINGNET-3623 | QA 19.11 .NET 3549不透明零件 | 增强功能 |
示例一:根据其自身的原始数据格式加载原始数据。
// Raw data after decoding is processed to eliminate format-specific effects (prediction and invert color component values). using (RasterImage image = (RasterImage)Image.Load("input.tif")) { image.LoadRawData(image.Bounds, image.RawDataSettings, new CustomRawDataLoader()); }
示例二:根据用户指定的原始数据格式加载原始数据。
// In this case, in addition, raw data is converted from its own format to the one specified by the user. // Note that so far not all raw data formats can be converted to other formats (since not all color converters are still implemented and registered at the ColorConverterFactory). using (RasterImage image = (RasterImage)Image.Load("input.tif")) { RawDataSettings rawDataSettings = new RawDataSettings() { PixelDataFormat = PixelDataFormat.Rgb24Bpp, DitheringMethod = DitheringMethods.PaletteIgnore, }; rawDataSettings.LineSize = ((image.Width * rawDataSettings.PixelDataFormat.BitsPerPixel) + 7) / 8; image.LoadRawData(image.Bounds, image.RawDataSettings, new CustomRawDataLoader()); }
示例三:加载未经处理的原始原始数据。
// Format-specific effects (prediction and invert color component values) may be present in this data, therefore this data cannot be used in color converters without pre-processing. using (RasterImage image = (RasterImage)Image.Load("input.tif")) { image.LoadRawData(image.Bounds, null, new CustomRawDataLoader()); } // Custom raw data loader class CustomRawDataLoader : IPartialRawDataLoader { ////// Processes the loaded data. //////The data rectangle.///The raw data.///The start data point. If not equal to (left,top) meaning that it is not full rectangle we have.///The end data point. If not equal to (right,bottom) meaning that it is not full rectangle we have.public void Process(Rectangle rectangle, byte[] data, Point start, Point end) { this.Process(rectangle, data, start, end, null); } ////// Processes the loaded data. //////The data rectangle.///The raw data.///The start data point. If not equal to (left,top) meaning that it is not full rectangle we have.///The end data point. If not equal to (right,bottom) meaning that it is not full rectangle we have.///The load options.public void Process(Rectangle rectangle, byte[] data, Point start, Point end, LoadOptions loadOptions) { // custom raw data processing } }
using (Image image = Image.Load("sample_car.svg")) { image.Resize(image.Width * 2, image.Height * 2); image.Save("sample_car_resize_2_2.png", new PngOptions()); }
// Setting a memory limit of 10 megabytes for target loaded image using (Image image = Image.Load("Default.tiff", new LoadOptions { BufferSizeHint = 10 })) { image.Save("Default_export.tiff", new TiffOptions(TiffExpectedFormat.Default)); } using (Image image = Image.Load("TiffCcitRle.tiff", new LoadOptions { BufferSizeHint = 10 })) { image.Save("TiffCcitRle_export.tiff", new TiffOptions(TiffExpectedFormat.TiffCcitRle)); } using (Image image = Image.Load("TiffDeflateRgb.tiff", new LoadOptions { BufferSizeHint = 10 })) { image.Save("TiffDeflateRgb_export.tiff", new TiffOptions(TiffExpectedFormat.TiffDeflateRgb)); } using (Image image = Image.Load("TiffJpegYCbCr.tiff", new LoadOptions { BufferSizeHint = 10 })) { image.Save("TiffJpegYCbCr_export.tiff", new TiffOptions(TiffExpectedFormat.TiffJpegYCbCr)); } using (Image image = Image.Load("TiffLzwCmyk.tiff", new LoadOptions { BufferSizeHint = 10 })) { image.Save("TiffLzwCmyk_export.tiff", new TiffOptions(TiffExpectedFormat.TiffLzwCmyk)); } using (Image image = Image.Load("TiffNoCompressionRgb.tiff", new LoadOptions { BufferSizeHint = 10 })) { image.Save("TiffNoCompressionRgb_export.tiff", new TiffOptions(TiffExpectedFormat.TiffNoCompressionRgb)); }
// Setting a memory limit of 10 megabytes for target loaded image using (Image image = Image.Load("flowers.gif", new LoadOptions { BufferSizeHint = 10 })) { image.Save("flowers_export.gif", new GifOptions()); }
string baseFolder = "D:\\images"; string outputFolderName = Path.Combine(baseFolder, "out"); string[] files = new[] { "MultiframePage1.dicom", "VariousObjectsMultiPage.odg" }; foreach (string inputFileName in files) { using (Image image = Image.Load(Path.Combine(baseFolder, inputFileName))) { PdfOptions imageOptions = new PdfOptions(); imageOptions.MultiPageOptions = new MultiPageOptions(new IntRange(1, 2)); if (image is VectorImage) { imageOptions.VectorRasterizationOptions = (VectorRasterizationOptions)image.GetDefaultOptions(new object[] { Color.White, image.Width, image.Height }); imageOptions.VectorRasterizationOptions.TextRenderingHint = TextRenderingHint.SingleBitPerPixel; imageOptions.VectorRasterizationOptions.SmoothingMode = SmoothingMode.None; } string outFileName = Path.Combine(outputFolderName, inputFileName + ".pdf"); image.Save(outFileName, imageOptions); } }
using (Image image = Image.Load(fileName)) { if (image is VectorImage) { ... } else { ... } }
using (Image image = Image.Load(fileName)) { if (image is IMultipageImage) { var pages = ((IMultipageImage)image).Pages; } }
int startPage = 3; int countPage = 2; using (Image image = Image.Load(fileName)) { PngOptions pngOptions = new PngOptions(); pngOptions.MultiPageOptions = new MultiPageOptions(new IntRange(startPage, countPage)); image.Save(outFileName, pngOptions); }
本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@pclwef.cn
知名C/C++开发工具CLion全新发布v2024.3,新版本新语言引擎有显著改进等,欢迎下载新版体验!
强大的VS插件CodeRush已正式发布v24.2.3,新版本现在可以运行xUnit.Net v3测试等,欢迎下载最新版体验!
Spire.PDF 10.12.4 最新版本支持在进行多页打印时设置自动旋转方向。同时,一些已知问题也在本次更新中被成功修复,例如打印 PDF 文档时内容丢失的问题,欢迎下载体验~
日程安排控件dhtmlxScheduler v7.2全新发布,新版本增强并增加了编辑、修改等多个操作体验,欢迎下载最新版试用~
服务电话
重庆/ 023-68661681
华东/ 13452821722
华南/ 18100878085
华北/ 17347785263
客户支持
技术支持咨询服务
服务热线:400-700-1020
邮箱:sales@pclwef.cn
关注我们
地址 : 重庆市九龙坡区火炬大道69号6幢