Example #1
0
        public ImageInfo(string id, IImageFormat format, Image image)
        {
            if (image == null)
            {
                throw new UnknownImageFormatException("Missing image");
            }

            Id         = id;
            Format     = format;
            Width      = image.Width;
            Height     = image.Height;
            ColorTable = new ImageCalculate(image).ColorTable;
        }
Example #2
0
 private bool ValidateImage(string fileName)
 {
     try
     {
         using (Image image = Image.Load(fileName, out IImageFormat format))
         {
             Width      = image.Width;
             Height     = image.Height;
             Format     = format;
             ColorTable = new ImageCalculate(image).ColorTable;
             return(true);
         }
     }
     catch (UnknownImageFormatException)
     {
         return(false);
     }
 }