Exemple #1
0
 private void btnBase64Bmp_ToBmp_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrWhiteSpace(rtxtBase64BmpStr.Text))
     {
         rtxtBase64BmpStr.Focus();
     }
     else
     {
         try
         {
             if (picBoxBase64Bmp.Image != null)
             {
                 picBoxBase64Bmp.Image.Dispose();
                 picBoxBase64Bmp.Image = null;
             }
             picBoxBase64Bmp.Image = Base64Helper.Base64ToImg(rtxtBase64BmpStr.Text.Replace("data:image/png;base64,", ""));
         }
         catch (Exception ex)
         {
             WinFormHelper.ShowError(ex);
         }
     }
 }