An image from byte to optimized web page presentation

Posted by blgnklc on Stack Overflow See other posts from Stack Overflow or by blgnklc
Published on 2010-05-07T06:40:19Z Indexed on 2010/05/07 6:48 UTC
Read the original article Hit count: 278

Filed under:
|
|
|
|

I get the data of the stored image on database as byte[] array; then I convert it to System.Drawing.Image like the code shown below;

  public System.Drawing.Image CreateImage(byte[] bytes)
        {

            System.IO.MemoryStream memoryStream = new System.IO.MemoryStream(bytes);
            System.Drawing.Image image = System.Drawing.Image.FromStream(memoryStream);
            return image;
        }

(*) On the other hand I am planning to show a list of images on asp.net pages as the client scrolls downs the page. The more user gets down and down on the page he/she does see the more photos. So it means fast page loads and rich user experience. (you may see what I mean on www.mashable.com, just take care the new loads of the photos as you scroll down.)

Moreover, the returned imgae object from the method above, how can i show it in a loop dynamically using the (*) conditions above.

Regards bk

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about image