本文整理汇总了C#中BitMiracle.LibTiff.Classic.Tiff.MergeFieldInfo方法的典型用法代码示例。如果您正苦于以下问题:C# Tiff.MergeFieldInfo方法的具体用法?C# Tiff.MergeFieldInfo怎么用?C# Tiff.MergeFieldInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitMiracle.LibTiff.Classic.Tiff
的用法示例。
在下文中一共展示了Tiff.MergeFieldInfo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TagExtender
public void TagExtender(Tiff tif)
{
TiffFieldInfo[] tiffFieldInfo =
{
new TiffFieldInfo(TIFFTAG_ASCIITAG, -1, -1, TiffType.ASCII, FieldBit.Custom, true, false, "MyTag"),
new TiffFieldInfo(TIFFTAG_SHORTTAG, 2, 2, TiffType.SHORT, FieldBit.Custom, false, true, "ShortTag"),
new TiffFieldInfo(TIFFTAG_LONGTAG, 2, 2, TiffType.LONG, FieldBit.Custom, false, true, "LongTag"),
new TiffFieldInfo(TIFFTAG_RATIONALTAG, 2, 2, TiffType.RATIONAL, FieldBit.Custom, false, true, "RationalTag"),
new TiffFieldInfo(TIFFTAG_FLOATTAG, 2, 2, TiffType.FLOAT, FieldBit.Custom, false, true, "FloatTag"),
new TiffFieldInfo(TIFFTAG_DOUBLETAG, 2, 2, TiffType.DOUBLE, FieldBit.Custom, false, true, "DoubleTag"),
new TiffFieldInfo(TIFFTAG_BYTETAG, 2, 2, TiffType.BYTE, FieldBit.Custom, false, true, "ByteTag"),
new TiffFieldInfo(TIFFTAG_IFDTAG, 1, 1, TiffType.IFD, FieldBit.Custom, false, false, "IfdTag"),
};
tif.MergeFieldInfo(tiffFieldInfo, tiffFieldInfo.Length);
if (m_parentExtender != null)
m_parentExtender(tif);
}
示例2: 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[]>();
}
示例3: TagExtender
// Helper methods
private static void TagExtender(Tiff tif)
{
TiffFieldInfo[] tiffFieldInfo = new TiffFieldInfo[1];
tiffFieldInfo[0] = new TiffFieldInfo((TiffTag)TagToWrite, -1, -1, TiffType.ASCII, FieldBit.Custom, true, false, "Tag." + TagToWrite);
tif.MergeFieldInfo(tiffFieldInfo, tiffFieldInfo.Length);
}