Example #1
0
        public uint GetZoomPropDesc(uint cameraHandle, out ZoomPropDesc propDesc)
        {
            uint   response = 0;
            uint   size     = (uint)this.BUFFER_SIZE;
            IntPtr pSpace   = Marshal.AllocHGlobal(this.BUFFER_SIZE);

            response = PR_GetDevicePropDesc(cameraHandle, (ushort)DevicePropCode.prPTP_DEV_PROP_ZOOM_POS, ref size, pSpace);
            if (response == 0)
            {
                propDesc = (ZoomPropDesc)Marshal.PtrToStructure(pSpace, typeof(ZoomPropDesc));
            }
            else
            {
                propDesc = null;
            }
            return(response);
        }
Example #2
0
 public uint GetZoomPropValue(uint cameraHandle, out ZoomPropDesc propDesc)
 {
     uint response = 0;
     uint size = (uint)this.BUFFER_SIZE;
     IntPtr pPropDesc = Marshal.AllocHGlobal(this.BUFFER_SIZE);
     response = PR_GetDevicePropValue(cameraHandle, (ushort)DevicePropCode.prPTP_DEV_PROP_ZOOM_POS, ref size, pPropDesc);
     if (response == 0)
     {
         var upropDesc = (ushort)Marshal.PtrToStructure(pPropDesc, typeof(ushort));
         propDesc = null;
     }
     else
     {
         propDesc = null;
     }
     return response;
 }