Example #1
0
        public EosImageEventArgs TransportAsFileName(IntPtr directoryItem, string imagePath, IntPtr context)
        {
            var directoryItemInfo = GetDirectoryItemInfo(directoryItem);
            var stream            = CreateFileStream(imagePath);

            Edsdk.EdsSetProgressCallback(stream, progress, Edsdk.EdsProgressOption.Periodically, context);
            Transport(directoryItem, directoryItemInfo.Size, stream, true);

            return(new EosFileImageEventArgs(imagePath));
        }
Example #2
0
        public EosMemoryImageEventArgs TransportInMemory(IntPtr directoryItem, IntPtr context)
        {
            var directoryItemInfo = GetDirectoryItemInfo(directoryItem);
            var stream            = CreateMemoryStream(directoryItemInfo.Size);

            try
            {
                Edsdk.EdsSetProgressCallback(stream, progress, Edsdk.EdsProgressOption.Periodically, context);
                Transport(directoryItem, directoryItemInfo.Size, stream, false);
                var converter = new EosConverter();
                return(new EosMemoryImageEventArgs(converter.ConvertImageStreamToBytes(stream))
                {
                    FileName = directoryItemInfo.szFileName
                });
            }
            finally
            {
                DestroyStream(ref stream);
            }
        }