本文整理汇总了C#中BitMiracle.LibTiff.Classic.Tiff.GetTagListCount方法的典型用法代码示例。如果您正苦于以下问题:C# Tiff.GetTagListCount方法的具体用法?C# Tiff.GetTagListCount怎么用?C# Tiff.GetTagListCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitMiracle.LibTiff.Classic.Tiff
的用法示例。
在下文中一共展示了Tiff.GetTagListCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TiffGrid
public TiffGrid(string filename, string NewFileName)
{
ValuesToWrite = new Dictionary<int, Dictionary<int, double>>();
tiff_org = BitMiracle.LibTiff.Classic.Tiff.Open(Path.GetFullPath(filename), "r");
tiff = BitMiracle.LibTiff.Classic.Tiff.Open(Path.GetFullPath(NewFileName), "w");
foreach (TiffTag enu in Enum.GetValues(typeof(TiffTag)))
{
var val = tiff_org.GetField(enu);
if (val != null & enu != TiffTag.EXTRASAMPLES)
tiff.SetField(enu, val[0]);
}
for (int i = 0; i < tiff_org.GetTagListCount(); i++)
{
int k = tiff_org.GetTagListEntry(i);
var ff = tiff_org.FindFieldInfo((TiffTag)k, TiffType.ANY);
tiff.MergeFieldInfo(new TiffFieldInfo[] { ff }, 1);
var val = tiff_org.GetField((TiffTag)tiff_org.GetTagListEntry(i));
tiff.SetField((TiffTag)k, val[0], val[1]);
}
var val2 = tiff_org.GetField((TiffTag)33922)[1].ToDoubleArray();
XOrigin = val2[3];
YOrigin = val2[4]; //Upper basegrid assumes Lower
val2 = tiff_org.GetField((TiffTag)33550)[1].ToDoubleArray();
GridSize = val2[0];
GridSize = val2[1];
NumberOfColumns = tiff_org.GetField(TiffTag.IMAGEWIDTH)[0].ToInt();
NumberOfRows = tiff_org.GetField(TiffTag.IMAGELENGTH)[0].ToInt();
//Shift YOrigin to lower left
YOrigin -= GridSize * NumberOfRows;
scanline = new byte[tiff_org.ScanlineSize()];
bits = scanline.Count() / NumberOfColumns;
ScanLineCache = new Dictionary<int, byte[]>();
}