Jan 17, 2012, 7:21 AM
How to read image from []byte or MemoryStream
hi,
I have a question that I don't know how to read a image from []byte or MemoryStream.
this is my code:
anyone can help me ?
thx~
I have a question that I don't know how to read a image from []byte or MemoryStream.
this is my code:
private void OutPutValidateImage(HttpResponse response)
{
Modules.Captcha c = new Modules.Captcha();
c.Width = 120;
c.Height = 40;
c.AutoWidth = true;
c.Type = Modules.CaptchaType.CharacterAndNumbers;
c.RandomTextColor = true;
c.RandomBackgroundNoiseColor = true;
byte[] binaryDatas = c.GenerateGraphic();
response.ClearContent();
response.ContentType = "image/Gif";
response.BinaryWrite(binaryDatas);
}
but Reminder error that 'OutputStream is not available when a custom TextWriter is used.'anyone can help me ?
thx~