/// <summary>
 /// Indicates whether two ManipulableImages have the same data.
 /// </summary>
 public static bool SameData(ManipulableImage a, ManipulableImage b)
 {
     return (a == null) == (b == null) &&
         a.Width == b.Width &&
         a.Height == b.Height &&
         a.Pixels.SequenceEqual<int>(b.Pixels);
 }
Esempio n. 2
0
 /// <summary>
 /// Saves a ManipulableImage to a Bitmap.
 /// </summary>
 /// <param name="img">The ManipulableImage to save.</param>
 /// <returns>The created Bitmap.</returns>
 public static Bitmap Save(ManipulableImage img)
 {
     Bitmap bmp = new Bitmap(img.Width, img.Height,
         PixelFormat.Format32bppPArgb);
     BitmapData data = bmp.LockBits(
         new Rectangle(0, 0, bmp.Width, bmp.Height),
         ImageLockMode.WriteOnly,
         PixelFormat.Format32bppPArgb);
     Marshal.Copy(img.Pixels, 0, data.Scan0, img.Pixels.Length);
     bmp.UnlockBits(data);
     return bmp;
 }
 public void TestInitialize()
 {
     img = LoadManipulableImage("3.bmp");
 }