Click here to Skip to main content
16,015,583 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
in place of httphandler how to write a image to a image control using binary writer?

public class ImageHandler : IHttpHandler
    {

      public void ProcessRequest(HttpContext context)
           {
            int id =1;
            Byte[] _image=QueryImage(id);
            context.Response.ContentType = image/jpeg;
            context.Response.BinaryWrite(_image);
             }
}

void loadImage()
{
  imageControl1.ImageUrl="~/ImageHandler.ashx";
}

*********
in place of this how do i do it with 
*********
 void loadImage()
{
            int id=1;
            using (var binaryWriter = new BinaryWriter(QueryImage(id))
            {
               variable X;
               binaryWriter(X);
               imageControl1.ImageUrl=X;


            }
}
Posted
Updated 22-Mar-13 10:26am
v2

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