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; } }
internal static extern bool saveImage(IntPtr fileName, int jpegQuality /*0-100*/, FubiUtils.ImageType type, FubiUtils.ImageNumChannels numChannels, FubiUtils.ImageDepth depth, uint renderOptions = (uint)FubiUtils.RenderOptions.Default, FubiUtils.DepthImageModification depthModifications = FubiUtils.DepthImageModification.UseHistogram, UInt32 userId = 0, FubiUtils.SkeletonJoint jointOfInterest = FubiUtils.SkeletonJoint.NUM_JOINTS);
public static bool saveImage(string fileName, int jpegQuality /*0-100*/, FubiUtils.ImageType type, FubiUtils.ImageNumChannels numChannels, FubiUtils.ImageDepth depth, uint renderOptions = (uint)FubiUtils.RenderOptions.Default, FubiUtils.DepthImageModification depthModifications = FubiUtils.DepthImageModification.UseHistogram, UInt32 userId = 0, FubiUtils.SkeletonJoint jointOfInterest = FubiUtils.SkeletonJoint.NUM_JOINTS) { IntPtr namePtr = Marshal.StringToHGlobalAnsi(fileName); bool ret = FubiInternal.saveImage(namePtr, jpegQuality, type, numChannels, depth, renderOptions, depthModifications, userId, jointOfInterest); Marshal.FreeHGlobal(namePtr); return(ret); }
internal static extern void getImage(IntPtr outputImage, FubiUtils.ImageType type, FubiUtils.ImageNumChannels numChannels, FubiUtils.ImageDepth depth, uint renderOptions = (uint)FubiUtils.RenderOptions.Default, FubiUtils.DepthImageModification depthModifications = FubiUtils.DepthImageModification.UseHistogram, UInt32 userId = 0, FubiUtils.SkeletonJoint jointOfInterest = FubiUtils.SkeletonJoint.NUM_JOINTS);