如何使用C#程序查找Tiff Image原点程序名称(即扫描的程序名称,如'Kofax标准多页')。 [英] How to find Tiff Image origin Program name (i.e. scanned Program name like 'Kofax standard Multi-Page') using a C# program.

查看:60
本文介绍了如何使用C#程序查找Tiff Image原点程序名称(即扫描的程序名称,如'Kofax标准多页')。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

手动我们可以在Tiff属性窗口的详细信息选项卡下看到此属性。



使用下面的代码可以读取一些属性,但是必需的属性程序名称无法读取。



Manually we can see this property under the Details tab of the Tiff's Properties window.

Using below code able to read some of the properties, but the required property of 'Program name' can't read.

using (FileStream stream = new FileStream(@"C:\0000001F.TIF", FileMode.Open,FileAccess.Read))
            {
                using (Image tif = Image.FromStream(stream))
                {

                    float width = tif.PhysicalDimension.Width;
                    float height = tif.PhysicalDimension.Height;
                    float hresolution = tif.HorizontalResolution;
                    float vresolution = tif.VerticalResolution;

                }
            }





感谢任何帮助。



Any help is appreciated.

推荐答案

我找到了答案。找到所需的属性为字节arry。以下是解决方案。有关完整说明,我将在我的博客上发表文章。



I found the answer for this. The required property is found as a byte arry. below is the solution. For full explanation I will post an article on my blog.

Encoding ascii = Encoding.ASCII;
            using (Bitmap image = new Bitmap(@"C:\0000001O.TIF"))
            {
                foreach (System.Drawing.Imaging.PropertyItem i in image.PropertyItems)
                {
                    if(i.Type==0x2)
                    {
                        MessageBox.Show(i.Value[0].ToString());
                       string  v = ascii.GetString(i.Value);
                       MessageBox.Show(v);
                    }
                    
                }
            }


这篇关于如何使用C#程序查找Tiff Image原点程序名称(即扫描的程序名称,如'Kofax标准多页')。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆