Ejemplo n.º 1
0
        private static ImageSource Decode(Stream stream, int size)
        {
            var tgaHeader  = TgaReader.ReadHeader(stream);
            var dataLength = (int)stream.Length - System.Runtime.InteropServices.Marshal.SizeOf(tgaHeader);
            var data       = ReadBytes(stream, dataLength);

            return(Decode(data, tgaHeader, size));
        }
Ejemplo n.º 2
0
 private static Option <TgaHeader> ReadHeader(string fileName)
 {
     try
     {
         using (var stream = new FileStream(fileName, FileMode.Open))
         {
             return(TgaReader.ReadHeader(stream));
         }
     }
     catch
     {
         return(Option <TgaHeader> .None);
     }
 }
        private static ImageSource CreateImageThumbnail(string absolutePath, int size)
        {
            var tgaReader = new TgaReader(absolutePath);

            return(tgaReader.Decode(size));
        }