コード例 #1
0
    // Get the video mode data that matches the given CameraDeviceMode.
    public VideoModeData GetVideoMode(CameraDeviceMode mode)
    {
        IntPtr videoModePtr = Marshal.AllocHGlobal(
            Marshal.SizeOf(typeof(VideoModeData)));

        cameraDeviceGetVideoMode((int)mode, videoModePtr);
        VideoModeData videoMode = (VideoModeData)Marshal.PtrToStructure
                                      (videoModePtr, typeof(VideoModeData));

        Marshal.FreeHGlobal(videoModePtr);

        return(videoMode);
    }
コード例 #2
0
    // Get the video mode data that matches the given CameraDeviceMode.
    public override VideoModeData GetVideoMode(CameraDeviceMode mode)
    {
        if (QCARRuntimeUtilities.IsPlayMode())
        {
            return(WebCam.GetVideoMode());
        }

        else
        {
            IntPtr videoModePtr = Marshal.AllocHGlobal(
                Marshal.SizeOf(typeof(VideoModeData)));
            QCARWrapper.Instance.CameraDeviceGetVideoMode((int)mode, videoModePtr);
            VideoModeData videoMode = (VideoModeData)Marshal.PtrToStructure
                                          (videoModePtr, typeof(VideoModeData));
            Marshal.FreeHGlobal(videoModePtr);

            return(videoMode);
        }
    }