C# Base64 String to PNG Image

Here’s how you can save a base64 encoded string to image file in C#. public void SaveImageFile(string filename, string base64Image) { string destinationImgPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + Constants.UserImagesPath+"\\"+filename+".png"; try { Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + Constants.UserImagesPath); } catch (IOException iox) { Console.WriteLine(iox.Message+" "+iox.Data); } var bytes = Convert.FromBase64String(base64Image); using (var imageFile = new FileStream(destinationImgPath, FileMode.Create)) { imageFile.Write(bytes, 0, bytes.Length); […]

Read More

How to Save a Transparent or a .png image file in Isolated Storage of Windows phone app

This is a small blog post in which I shall explain you how to save a transparent or a .png image file in isolated storage of Windows phone app. By default you can save a WriteableBitmap object as .jpeg image file in the isolated storage of your application using SaveJpeg method. But you can easily […]

Read More