Exemple #1
0
        public static Color[] ReadImage(string path, int xSamples, int ySamples)
        {
            var info  = FromPath(path);
            var image = Image.ReadFromFile(info);

            return(Image.Pixels(image, xSamples, ySamples).SelectMany(x => x).ToArray());
        }
Exemple #2
0
 public void Image_ReadFromFile()
 {
     foreach (var file in GetTestImageFiles())
     {
         Image.ReadFromFile(File.FromPath(file));
         Assert.DoesNotThrow(
             () =>
         {
             using (System.IO.File.OpenRead(file)) { }     //Check that it's not locked
         },
             "File is locked after being read!");
     }
 }
Exemple #3
0
 public static Bitmap LoadImageFromPath(string path)
 {
     return(Image.ReadFromFile(FromPath(path)));
 }