OpenNI.Context.AddLicense C# (CSharp) Method

AddLicense() public method

public AddLicense ( License license ) : void
license License
return void
        public void AddLicense(License license)
        {
            IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf(license));
            try
            {
                int status = SafeNativeMethods.xnAddLicense(this.InternalObject, ptr);
                WrapperUtils.ThrowOnError(status);
            }
            finally
            {
                Marshal.FreeHGlobal(ptr);
            }
        }

Usage Example

コード例 #1
0
    // 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;
        }
    }
All Usage Examples Of OpenNI.Context::AddLicense