private uint MyGetFileDataCB(uint cameraHandle, uint objectHandle, uint context, ref PrProgress pProgress) { if (pProgress.lMessage == PrProgressMsg.prMSG_DATA_HEADER) { this.m_buffer = new byte[0]; } if (pProgress.lMessage == PrProgressMsg.prMSG_DATA) { uint length = pProgress.lOffset + pProgress.lLength; Array.Resize(ref this.m_buffer, (int)length); IntPtr pData = new IntPtr((int)pProgress.pbData); Marshal.Copy(pData, this.m_buffer, (int)pProgress.lOffset, (int)pProgress.lLength); } if (pProgress.lMessage == PrProgressMsg.prMSG_TERMINATION) { this.m_getFileCallback.Invoke(this.m_buffer); } return((uint)PR_Error.prOK); }
private uint MyGetFileDataCB(uint cameraHandle, uint objectHandle, uint context, ref PrProgress pProgress) { if (pProgress.lMessage == PrProgressMsg.prMSG_DATA_HEADER) { this.m_buffer = new byte[0]; } if (pProgress.lMessage == PrProgressMsg.prMSG_DATA) { uint length = pProgress.lOffset + pProgress.lLength; Array.Resize(ref this.m_buffer, (int)length); IntPtr pData = new IntPtr((int)pProgress.pbData); Marshal.Copy(pData, this.m_buffer, (int)pProgress.lOffset, (int)pProgress.lLength); } if (pProgress.lMessage == PrProgressMsg.prMSG_TERMINATION) { this.m_getFileCallback.Invoke(this.m_buffer); } return (uint)PR_Error.prOK; }