[SerializableAttribute ()]
公共类RasterCommentMetadata:RasterMetadata
< SerializableAttribute () >
公共类RasterCommentMetadata
继承了RasterMetadata
@接口LTRasterCommentMetadata: LTRasterMetadata
公共类RasterCommentMetadata扩展RasterMetadata实现了可序列化的
[SerializableAttribute ()]
公共ref类RasterCommentMetadata:公共RasterMetadata
TIFF文件格式支持的评论数保存和加载使用预定义的标记。
如果意见不符合您的需要,您可以定义您自己的标记为节省额外non-raster TIFF文件中的数据。例如,您可能需要定义一个标签保存注释。
TIFF 6.0规范预留,开发人员可以定义一系列私人标签。为了避免与其他开发人员创建的文件相冲突,你可以注册你的标签通过联系Adobe开发人员关系。电子邮件地址发布在非官方TIFF主页gapdevsup@adobe.com。
一些限制适用于这个函数如果你使用一个IFD页面写元数据表示。看到加载和保存大TIFF文件主题的更多信息。
这个例子写评论气管无名动脉瘘管的不同数据类型的现有文件然后读取测试。
使用Leadtools;
使用Leadtools.Codecs;
公共无效RasterCommentMetadataExample ()
{
RasterCodecs编解码器=新RasterCodecs ();
编解码器。ThrowExceptionsOnInvalidImages =真正的;
字符串srcFileName = Path.Combine (LEAD_VARS.ImagesDir,“Image1.cmp”);
字符串destFileName = Path.Combine (LEAD_VARS.ImagesDir,“Image1_comments.tif”);
/ /加载图像
RasterImage图像= codecs.Load (srcFileName);
编解码器。保存(图像、destFileName RasterImageFormat。Tif, 24);
image.Dispose ();
/ /写一些评论气管无名动脉瘘管的现有文件
RasterCommentMetadata评论=新RasterCommentMetadata ();
发表评论。类型= RasterCommentMetadataType.Artist;
字符串artistNameWrite =“艺术家名称”;
comment.FromAscii (artistNameWrite);
Console.WriteLine (“写艺术家”);
编解码器。WriteComment (destFileName 1评论);
发表评论。类型= RasterCommentMetadataType.GpsLatitude;
RasterMetadataRational [] rationalsWrite =新RasterMetadataRational [3];
为(int我= 0;我< rationalsWrite.Length;我+ +)
rationalsWrite[我]=新RasterMetadataRational(我+ 3,+ 2);
comment.FromRational (rationalsWrite);
Console.WriteLine (“写作GpsLatitude”);
编解码器。WriteComment (destFileName 1评论);
/ /现在评论从tif文件读
/ /读ASCII
评论=编解码器。ReadComment (destFileName 1 RasterCommentMetadataType.Artist);
字符串artistNameRead = comment.ToAscii ();
Console.WriteLine (“艺术家:{0}”,artistNameRead);
断言。IsTrue (artistNameRead = = artistNameWrite);
/ /读理性
评论=编解码器。ReadComment (destFileName 1 RasterCommentMetadataType.GpsLatitude);
RasterMetadataRational [] rationalsRead = comment.ToRational ();
int大小= rationalsRead.Length;
Console.WriteLine (“GpsLatitude:大小= {0}”、大小);
为(int我= 0;我<大小;我+ +)
Console.WriteLine (“{0}/ {1}”,rationalsRead[我]。分子,rationalsRead[我].Denominator);
Assert.IsTrue (rationalsRead。长度= = rationalsWrite.Length);
为(int我= 0;我< rationalsRead.Length;我+ +)
{
Assert.IsTrue (rationalsRead[我]。分子= = rationalsWrite[我].Numerator);
Assert.IsTrue (rationalsRead[我]。分母= = rationalsWrite[我].Denominator);
}
}
静态类LEAD_VARS
{
公共常量字符串ImagesDir =@“C: \ LEADTOOLS21 \ Resources \图片”;
}
进口Leadtools
进口Leadtools.Codecs
公共子RasterCommentMetadataExample ()
昏暗的编解码器作为RasterCodecs =新RasterCodecs ()
编解码器。ThrowExceptionsOnInvalidImages =真正的
昏暗的srcFileName作为字符串= Path.Combine (LEAD_VARS.ImagesDir“Image1.cmp”)
昏暗的destFileName作为字符串= Path.Combine (LEAD_VARS.ImagesDir“Image1_comments.tif”)
“加载图片
昏暗的图像作为RasterImage = codecs.Load (srcFileName)
编解码器。保存(图像、destFileName RasterImageFormat。Tif, 24)
image.Dispose ()
气管无名动脉瘘管的现有文件的写一些评论
昏暗的评论作为RasterCommentMetadata =新RasterCommentMetadata ()
发表评论。类型= RasterCommentMetadataType.Artist
昏暗的artistNameWrite作为字符串=“艺术家名称”
comment.FromAscii (artistNameWrite)
Console.WriteLine (“写艺术家”)
编解码器。WriteComment (destFileName 1评论)
发表评论。类型= RasterCommentMetadataType.GpsLatitude
昏暗的rationalsWrite作为RasterMetadataRational () =新RasterMetadataRational (2) {}
昏暗的我作为整数= 0
做而我< rationalsWrite.Length
rationalsWrite (i) =新RasterMetadataRational(我+ 3,+ 2)
我+ = 1
循环
comment.FromRational (rationalsWrite)
Console.WriteLine (“写作GpsLatitude”)
编解码器。WriteComment (destFileName 1评论)
“现在阅读评论从tif文件
“读ASCII
评论=编解码器。ReadComment (destFileName 1 RasterCommentMetadataType.Artist)
昏暗的artistNameRead作为字符串= comment.ToAscii ()
Console.WriteLine (“艺术家:{0}”artistNameRead)
调试。作为sert(artistNameRead = artistNameWrite)
“读理性
评论=编解码器。ReadComment (destFileName 1 RasterCommentMetadataType.GpsLatitude)
昏暗的rationalsRead作为RasterMetadataRational () = comment.ToRational ()
昏暗的大小作为整数= rationalsRead.Length
Console.WriteLine (“GpsLatitude:大小= {0}”、大小)
我= 0
做而我<大小
Console.WriteLine (“{0}/ {1}”rationalsRead (i)。分子,rationalsRead(我).Denominator)
我+ = 1
循环
Debug.Assert (rationalsRead。长度= rationalsWrite.Length)
我= 0
做而我< rationalsRead.Length
Debug.Assert (rationalsRead(我)。分子= rationalsWrite(我).Numerator)
Debug.Assert (rationalsRead(我)。分母= rationalsWrite(我).Denominator)
我+ = 1
循环
结束子
公共NotInheritable类LEAD_VARS
公共常量ImagesDir作为字符串=“C: \ LEADTOOLS21 \ Resources \图片”
结束类
帮助收藏
光栅net|C API|c++类库|HTML5 JavaScript
文档net|C API|c++类库|HTML5 JavaScript
医疗net|C API|c++类库|HTML5 JavaScript
医疗Web查看器net
188宝金博怎么下载
支持的平台上
net, Java, Android和iOS / macOS组件
C / c++类库的API
HTML5 JavaScript库
你的邮件已经发送到支持!有人应该联系!如果你的问题是紧急请回到聊天。
聊天时间:
周一——周五,上午6点等
谢谢你的反馈!
请填写表单重新开始一个新的聊天。
所有代理目前离线。
聊天时间:
周一-周五
早上8:30 - 6点
联系我们请填写这张表格,我们将通过电子邮件联系你。