/// <summary>
        /// Load a bitmap from a binary file
        /// </summary>
        /// <param name="r">The file to read from</param>
        static public Bitmap LoadBitmapFromFile(ref BinaryReader r)
        {
            int bytes = r.ReadInt32();

            byte[] image = r.ReadBytes(bytes);

            return(ImageFunctions.ByteArrayToImage(image));
        }
 /// <summary>
 /// Save a bitmap to a binary file
 /// </summary>
 /// <param name="b">The image to save</param>
 /// <param name="w">The file to save it to</param>
 static public void SaveBitmapToFile(Bitmap b, ref BinaryWriter w)
 {
     byte[] image = ImageFunctions.ImageToByteArray(b);
     w.Write(image.Length);
     w.Write(image);
 }
 public static Bitmap Resize(this Bitmap image, int newWidth, int newHeight)
 {
     return(ImageFunctions.ResizeBitmap(image, newWidth, newHeight));
 }