【发布时间】:2011-09-05 21:27:06
【问题描述】:
我有一个问题,C# 中的 Bitmap 类没有正确加载 CCITT T.6 Tiff 文件,它会翻转它,所以高度是宽度,宽度是高度。
有没有人做过这些并且知道正确的处理方法?
编辑:
代码如下:
Bitmap B = new Bitmap(@"C:\test2.tif");
Debug.WriteLine(B.Width); //returns 1728
Debug.WriteLine(B.Height); //returns 1127
当我在 .net 图片框中显示它(SizeMode 设置为 Normal)时,它也显示不正确(拉伸)。但如果我用 Windows 照片查看器打开它,它会正确显示。
这些是 tiff 文件中可用的标签:
SubFileType (1 Long): Page
ImageWidth (1 Long): 1728
ImageLength (1 Long): 1127
BitsPerSample (1 Short): 1
Compression (1 Short): Group 4 Fax (aka CCITT FAX4)
Photometric (1 Short): MinIsWhite
FillOrder (1 Short): Lsb2Msb
StripOffsets (1 Long): 8
SamplesPerPixel (1 Short): 1
RowsPerStrip (1 Long): 1127
StripByteCounts (1 Long): 14764
XResolution (1 Rational): 204
YResolution (1 Rational): 98
Group3Options (1 Long): 5
ResolutionUnit (1 Short): Inch
PageNumber (2 Short): 0, 0
Software (32 ASCII): Windows NT Fax Server
CleanFaxData (1 Short): 0
ConsecutiveBadFaxLines (1 Short): 0
37680 (5632 Undefined):
40003 (26 ASCII): U.S. Robotics 56K FAX EXT
40005 (1 ASCII):
40046 (1 Long): 1
40047 (1 Long): 4
40048 (1 Long): 256
40049 (1 Long): 18
40051 (1 SRational):
40052 (1 SRational):
40053 (1 Long): 2
【问题讨论】:
-
向我们展示您正在使用的代码。