.NET Tiff 问题 C#
我在 TIFF 方面遇到问题
这是我必须做的,我们将 tiff 图像保存到数据库中,这些图像是 CCITT4 压缩的,带有许多必需的标签,其中包括:
RowsPerStrip 必须是 ImageLength
光度解释必须是 MinIsWhite
Multi -strip 图像格式是不允许的
我的问题是,我正在使用内置的 System.Drawing.Bitmap/Image 对象,当我将其放入对象中时,这些对象的值会发生变化,我已经通过保存进行了测试直接从数据库将 byte[] 转换为 tiff,检查标签,它们很好。但是当我将字节放入 Image 对象然后保存到文件时,它们被修改了。
更糟糕的是,我需要在保存图像之前向图像添加文本。
因此,我需要一个组件,它可以让我更好地控制 TIFF(它们必须是 tiff),并且能够向图像添加文本或能够使用 Graphics 对象。
我尝试过使用 LibTiff 但我还没有看到任何有关如何使用此组件的示例, 有什么建议吗?
I'm having issues with TIFFs
Here is what I have to do, we have tiff images saved into the database, these images are CCITT4 compressed with a number of required tags, these include:
RowsPerStrip must be the ImageLength
Photometric Interpreation must be MinIsWhite
Multi-strip image format is not allowed
My problem is, I'm using the built in System.Drawing.Bitmap/Image objects, which happen to change the values of these when I put it into the object, I've tested this by saving the byte[] to a tiff directly from the database, checked the tags, they are fine.. but when i put the bytes into an Image object then save to file, they are modified.
To make things worse, I'm needing to add a text to the image before saving it.
So I need a component that will allow me more control with TIFF (and they must be tiff), and be able to add text to an image or be able to use the Graphics object.
I've tried using LibTiff but I have yet to see any examples on how to use this component,
any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
为此,您可以使用我们的免费开源 LibTiff.Net 库。它可以在 BSD 许可证下免费供所有用途使用。刚刚发布的 2.0 版本包含良好的文档和大量示例。
有一些示例演示如何将任何非平铺 TIFF 图像转换为将所有数据写入单个条带中的 TIFF 图像,以及如何将 System.Drawing.Bitmap 转换为 1 位 CCITT 单条 TIFF 图像。
You can use our free and open-source LibTiff.Net library for this. It is freely available for all uses under a BSD license. The just released version 2.0 contains good documentation and number of samples.
There are samples that show how to convert any non-tiled TIFF image to the TIFF image which have all data written in a single strip and how to convert a System.Drawing.Bitmap to 1-bit CCITT single strip TIFF image.
我从未使用内置的 int System.Drawing.Bitmap 对象来执行此操作。我个人使用 LeadTools,但它不是免费的。然而,它是一个强大且相当简单的 API。我主要将它用于 GEOTiff,其中包含图像位置数据的特定数据标签。
如果您想尝试一下,可以享受 60 天评估。
I have never used the built int System.Drawing.Bitmap objects to do this. I personally use LeadTools, but it isn't free. It is however a robust and fairly straightforward API. I primarily use it for GEOTiff which contain specific data tags for image location data.
There is a 60 day evaluation if you would like to try it out.
我使用 FreeImage。还有一个 C# .NET 包装器可用。
I use FreeImage. There's a C# .NET wrapper available too.
HiComponents 的 IEvolution 组件集现在完全免费(无来源) - http://www.hicomponents.com 。一个非常强大的.NET 成像工具包。
The IEvolution component set from HiComponents is now totally free (no source) - http://www.hicomponents.com. A very powerful .NET imaging toolkit.