public Bitmap(int width, int height, IntPtr data) { Width = width; Height = height; nativeImage = new NativeImage() { Width = width, Height = height, Data = data }; }
public Bitmap(Stream stream) { byte[] buffer = new byte[16 * 1024]; byte[] allBytes; using (MemoryStream ms = new MemoryStream()) { int read; while ((read = stream.Read(buffer, 0, buffer.Length)) > 0) { ms.Write(buffer, 0, read); } allBytes = ms.ToArray(); } nativeImage = Binding.LoadImage(allBytes, allBytes.Length); Width = nativeImage.Width; Height = nativeImage.Height; }
public Bitmap(string filename) { nativeImage = Binding.LoadImage(filename); Width = nativeImage.Width; Height = nativeImage.Height; }
private static extern NativeDiffResult DiffARGB(NativeImage left, NativeImage right, NativeDiffOptions options);
internal static extern void SavePng(NativeImage image, string filename);