using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Web;
using System.Drawing.Imaging;
namespace Html5Image.Tools
{
public class ImageTool
{
//图片 转为 base64编码的文本
public static string ImgToBase64String(Bitmap bmp)
{
//Bitmap bmp = new Bitmap(Imagefilename);
//this.pictureBox1.Image = bmp;
//FileStream fs = new FileStream(Imagefilename + ".txt", FileMode.Create);
//StreamWriter sw = new StreamWriter(fs);
MemoryStream ms = new MemoryStream();
bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] arr = new byte[ms.Length];
ms.Position = 0;
ms.Read(arr, 0, (int)ms.Length);
ms.Close();
String strbaser64