SHARE
TWEET

Untitled

a guest May 19th, 2017 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         private void Convert_Click(object sender, EventArgs e)
  2.         {
  3.             MemoryStream MemStream = new MemoryStream();
  4.         // YourPicture = Your PictureBox
  5.             YourPicture.Image.Save(MemStream, System.Drawing.Imaging.ImageFormat.Png);
  6.             byte[] pngBase = MemStream.ToArray();
  7.             MemStream.Close();
  8.         //pngBase64 = Your TextBox
  9.             pngBase64.Text = Convert.ToBase64String(pngBase);
  10.         }
RAW Paste Data
Want to get better at C#?
Learn to code C# in 2017
Top