本文整理匯總了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;
}
}