本文整理汇总了C#中OpenNI.Context.AddLicense方法的典型用法代码示例。如果您正苦于以下问题:C# Context.AddLicense方法的具体用法?C# Context.AddLicense怎么用?C# Context.AddLicense使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenNI.Context
的用法示例。
在下文中一共展示了Context.AddLicense方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OpenNIContext
// private ctor for singleton
private OpenNIContext()
{
this.context = new Context();
if (null == context)
{
return;
}
if (oniFile != "") {
context.OpenFileRecording(oniFile);
}
// NITE license from OpenNI.org
License ll = new License();
ll.Key = "0KOIk2JeIBYClPWVnMoRKn5cdY4=";
ll.Vendor = "PrimeSense";
context.AddLicense(ll);
this.Depth = openNode(NodeType.Depth) as DepthGenerator;
this.mirror = this.Depth.MirrorCapability;
if (oniFile == "") {
this.Mirror = true;
}
}
示例2: Awake
public void Awake()
{
Debug.Log("Initing OpenNI" + (LoadFromXML ? "(" + XMLFilename + ")" : ""));
try {
this.context = LoadFromXML ? new Context(XMLFilename) : new Context();
}
catch (Exception ex) {
Debug.LogError("Error opening OpenNI context: " + ex.Message);
return;
}
// add license manually if not loading from XML
if (!LoadFromXML) {
License ll = new License();
ll.Key = LicenseKey;
ll.Vendor = LicenseVendor;
context.AddLicense(ll);
}
if (LoadFromRecording)
{
context.OpenFileRecordingEx(RecordingFilename);
Player player = openNode(NodeType.Player) as Player;
player.PlaybackSpeed = 0.0;
StartCoroutine(ReadNextFrameFromRecording(player));
}
this.Depth = openNode(NodeType.Depth) as DepthGenerator;
this.mirrorCap = this.Depth.MirrorCapability;
if (!LoadFromRecording) {
this.mirrorCap.SetMirror(Mirror);
mirrorState = Mirror;
}
}
示例3: Open
void Open(int i)
{
try
{
Close(i);
OpenNIState state = FState[i];
var context = new Context();
FState[i].Context = context;
context.AddLicense(FLicense);
context.GlobalMirror = false;
NodeInfoList list = context.EnumerateProductionTrees(global::OpenNI.NodeType.Device, null);
NodeInfo node = null;
if (FPinInNodes[i] != "")
{
foreach (NodeInfo nodeitem in list)
{
if (nodeitem.CreationInfo == FPinInNodes[i])
{
node = nodeitem;
break;
}
}
if (node == null)
throw (new Exception("This device is unavailable. Check upstream ListDevices node"));
context.CreateProductionTree(node);
}
state.DepthGenerator = new DepthGenerator(context);
MapOutputMode depthMode = new MapOutputMode();
depthMode.FPS = 30;
depthMode.XRes = 640;
depthMode.YRes = 480;
state.DepthGenerator.MapOutputMode = depthMode;
state.DepthGenerator.StartGenerating();
state.Start();
FPinOutContext[i] = state;
FPinOutStatus[i] = "OK";
}
catch (Exception e)
{
Close(i);
FPinOutStatus[i] = e.Message;
}
}