←选择平台

LoadFromMemory方法

总结
创建一个SvgDocument对象的数据保存在内存缓冲区。
语法
c#
VB
objective - c
c++
Java
公共静态SvgDocumentLoadFromMemory (字节[]缓冲,int抵消,int长度,SvgLoadOptions选项)
公共共享函数LoadFromMemory (_按值传递缓冲()作为字节,_按值传递抵消作为整数,_按值传递长度作为整数,_按值传递选项作为SvgLoadOptions_)作为SvgDocument
(可空instancetype) initWithData:(NSData *)数据选择:(nullable LTSvgLoadOptions *)选项错误:错误(NSError * *)
公共静态SvgDocument loadFromMemory (字节[]缓冲,int抵消,int长度,SvgLoadOptions选项)
公共:静态SvgDocument ^LoadFromMemory (数组<字节> ^缓冲,int抵消,int长度,SvgLoadOptions ^选项)

参数

缓冲
包含SVG数据的缓冲区。

抵消
基于偏移到缓冲数据开始。

长度
读取的字节数。

选项
在加载选项来使用。如果这个参数是,然后一个默认SvgLoadOptions对象将被使用。

返回值

SvgDocument这个方法创建对象。

讲话

获取和设置文档的范围和分辨率的信息,请参考SVG大小、范围和持平

例子
c#
VB
使用Leadtools;使用Leadtools.Codecs;使用Leadtools.Drawing;使用Leadtools.Forms.DocumentWriters;使用Leadtools.Svg;使用LeadtoolsExamples.Common;公共无效SvgLoadFromMemoryExample (){/ /假设SVG文件位于这里字符串srcFileName = Path.Combine (ImagesPath.Path,“Page1.svg”);/ /文件加载到内存中字节[]data = File.ReadAllBytes (srcFileName);/ /加载SVG使用(= SvgDocument SvgDocument文档。LoadFromMemory(数据、0 data.Length)){/ /准备它如果(document.IsFlat !)document.Flat ();如果(document.Bounds.IsValid !)document.CalculateBounds ();/ /显示其属性Console.WriteLine (”界限:“+ document.Bounds.Bounds);Console.WriteLine (解析:“+ document.Bounds.Resolution);}}
进口Leadtools进口Leadtools.Codecs进口Leadtools.Drawing进口Leadtools.Forms.DocumentWriters进口Leadtools.Svg公共共享SvgLoadFromMemoryExample ()“假设SVG文件位于这里昏暗的srcFileName作为字符串= Path.Combine (Common.ImagesPath.Path“Page1.svg”)文件加载到内存中昏暗的数据()作为字节= File.ReadAllBytes (srcFileName)SVG的加载使用文档作为SvgDocument = SvgDocument。LoadFromMemory (data, 0, data.Length,没有什么)“准备它如果document.IsFlat然后document.Flat (没有什么)结束如果如果document.Bounds.IsValid然后document.CalculateBounds ()结束如果“显示其属性Console.WriteLine (”界限:“+ document.Bounds.Bounds.ToString ())Console.WriteLine (解析:“+ document.Bounds.Resolution.ToString ())结束使用结束
需求

目标平台

另请参阅

参考

SvgDocument类

SvgDocument成员

Leadtools.Svg作为sembly
188金宝搏的网址客服|支持|联系我们|知识产权的通知
©1991 - 2021领先的技术公司。保留所有权利。