Ejemplo n.º 1
0
 private void TryBase64Conversion(String url, String localfile)
 {
     try
     {
         // Base 64:
         // data:image/jpeg;base64,XXXXXXXXXXXXXXXXX
         String pattern = "data:image/jpeg;base64,";
         if (url.StartsWith(pattern))
         {
             String data = url.Replace(pattern, "");
             Image  img  = MyTools.Base64ToImage(data);
             img.Save(localfile, System.Drawing.Imaging.ImageFormat.Jpeg);
             img.Dispose();
         }
     }
     catch (Exception)
     {
     }
 }