Click here to Skip to main content
15,921,793 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
byte[] im = (byte[])dt.Rows[0]["Photo"];
Bitmap Image = new Bitmap(new MemoryStream(im));


I can draw it in bytes using
Response.ContentType = path;
Response.BinaryWrite(im);


But i want to do the same with Bitmap .
Posted
Updated 12-Jul-11 1:17am
v2

1 solution

If you want to do what I think, give this a try:

Response.Clear();
Response.ContentType = "image/bmp";
byte[] im = (byte[])dt.Rows[0]["Photo"];
bm Image = new Bitmap(new MemoryStream(im));
bm.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Bmp)


Be careful about cleaning up your memory.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900