我有一個問題,在C#中的Bitmap類不正確加載CCITT T.6 Tiff文件,它會翻轉它,所以高度是寬度和寬度是高度。加載CCITT T.6與GDI +位圖類
有沒有人做過這些,並知道處理它們的正確方法?
編輯:
下面是代碼:
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
向我們展示您正在使用的代碼。 – Amy 2011-06-01 00:25:49