當前位置: 首頁>>代碼示例>>C#>>正文


C# Context.AddLicense方法代碼示例

本文整理匯總了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;
        }
    }
開發者ID:corybarr,項目名稱:PlanetariumSwarm,代碼行數:25,代碼來源:OpenNIContext.cs

示例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;
        }
    }
開發者ID:CodeStrumpet,項目名稱:Elemental,代碼行數:34,代碼來源:OpenNIContext.cs

示例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;
			}
		}
開發者ID:smakhtin,項目名稱:VVVV.Nodes.Image,代碼行數:52,代碼來源:ContextNode.cs


注:本文中的OpenNI.Context.AddLicense方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。