Пример #1
0
        public static void getImage(byte[] outputImage, FubiUtils.ImageType type, FubiUtils.ImageNumChannels numChannels, FubiUtils.ImageDepth depth,
                                    uint renderOptions = (uint)FubiUtils.RenderOptions.Default,
                                    FubiUtils.DepthImageModification depthModifications = FubiUtils.DepthImageModification.UseHistogram,
                                    uint userId = 0, FubiUtils.SkeletonJoint jointOfInterest = FubiUtils.SkeletonJoint.NUM_JOINTS)
        {
            if (outputImage != null)
            {
                int size = outputImage.Length + 1;

                // allocate memory for resource data
                IntPtr ptr = Marshal.AllocHGlobal(size);

                // load resource
                FubiInternal.getImage(ptr, type, numChannels, depth, renderOptions, depthModifications, userId, jointOfInterest);

                // copy byte data into allocated memory
                Marshal.Copy(ptr, outputImage, 0, outputImage.Length);


                Marshal.WriteByte(ptr, size, 0x00);
                // free previously allocated memory
                Marshal.FreeHGlobal(ptr);

                return;
            }
        }