日期:2014-05-17 浏览次数:21047 次
using System;
using System.Drawing;
using System.IO;
using System.Collections;
using System.Drawing;
namespace VFPSticker
{
/// <summary>
/// Description of ImageConverter.
/// </summary>
public class ImageConverter
{
public ImageConverter()
{
}
public byte[] imageToByteArray(Image imageIn)
{
MemoryStream ms = new MemoryStream();
imageIn.Save(ms, Imaging.ImageFormat.Gif);
return ms.ToArray();
}
public Image byteArrayToImage(byte[] byteArrayIn)
{
MemoryStream ms = new MemoryStream(byteArrayIn);
Image returnImage = Image.FromStream(ms);
return returnImage;
}
public static void Main()
{
}
}
}