public IntPtr ReadBlob(IMagickSettings <QuantumType> settings, byte[] data, int offset, int length)
{
using (INativeInstance settingsNative = MagickSettings.CreateInstance(settings))
{
IntPtr exception = IntPtr.Zero;
IntPtr result;
#if PLATFORM_AnyCPU
if (OperatingSystem.Is64Bit)
#endif
#if PLATFORM_x64 || PLATFORM_AnyCPU
result = NativeMethods.X64.MagickImageCollection_ReadBlob(settingsNative.Instance, data, (UIntPtr)offset, (UIntPtr)length, out exception);
#endif
#if PLATFORM_AnyCPU
else
#endif
#if PLATFORM_x86 || PLATFORM_AnyCPU
result = NativeMethods.X86.MagickImageCollection_ReadBlob(settingsNative.Instance, data, (UIntPtr)offset, (UIntPtr)length, out exception);
#endif
var magickException = MagickExceptionHelper.Create(exception);
if (magickException == null)
{
return(result);
}
if (magickException is MagickErrorException)
{
if (result != IntPtr.Zero)
{
Dispose(result);
}
throw magickException;
}
RaiseWarning(magickException);
return(result);
}
}