Ejemplo n.º 1
0
        public Image CreateImage(MemoryFlags flags, ImageFormat format, ImageDescriptor descriptor, IntPtr hostAddress)
        {
            if (hostAddress == IntPtr.Zero && (flags & (MemoryFlags.UseHostPointer | MemoryFlags.CopyHostPointer)) != 0)
                throw new ArgumentException("Invalid host address.");
            if (hostAddress != IntPtr.Zero && (flags & (MemoryFlags.UseHostPointer | MemoryFlags.CopyHostPointer)) == 0)
                throw new ArgumentException("Invalid host address.");

            ImageSafeHandle handle = UnsafeNativeMethods.CreateImage(Handle, flags, ref format, ref descriptor, hostAddress);
            return new Image(this, handle);
        }
Ejemplo n.º 2
0
 public Image CreateImage(MemoryFlags flags, ImageFormat format, ImageDescriptor descriptor)
 {
     return CreateImage(flags, format, descriptor, IntPtr.Zero);
 }