showing ASP.NET thumbnails

Discussion in 'ASP .Net' started by =?Utf-8?B?YXNhZA==?=, Apr 10, 2005.

  1. Hello friends, i have a directory in which my uploaded images are stored i
    want to create thumnails of these images dynamically and show these thumbnail
    how can i do this pls tell me about that.
    Thanks
    =?Utf-8?B?YXNhZA==?=, Apr 10, 2005
    #1
    1. Advertising

  2. Hi, asad,

    Here's 3 links to online code for generating thumbnails.

    http://www.dotnetjunkies.com/HowTo/C4A2ACC3-C6B4-4E4C-802A-85B8DBEC7F25.dcik

    http://authors.aspalliance.com/chrisg/tools/view-image2.asp

    http://www.mcse.ms/archive109-2003-11-80290.html

    You might also want to download and examine the free
    Community Starter Kit. It has a thumbnail-generation module :

    http://www.asp.net/StarterKits/DownloadCommunity.aspx?tabindex=0&tabid=1




    Juan T. Llibre
    ASP.NET MVP
    http://asp.net.do/foros/
    Foros de ASP.NET en EspaƱol
    Ven, y hablemos de ASP.NET...
    ======================

    "asad" <> wrote in message
    news:...
    > Hello friends, i have a directory in which my uploaded images are stored i
    > want to create thumnails of these images dynamically and show these
    > thumbnail
    > how can i do this pls tell me about that.
    > Thanks
    Juan T. Llibre, Apr 10, 2005
    #2
    1. Advertising

  3. You can resize the image using the GetThumbnailImage method.
    Here's more info:
    http://msdn.microsoft.com/library/d...emDrawingImageClassGetThumbnailImageTopic.asp

    Or maybe you'll find these custom functions useful that I wrote:

    public Image DisplaySize(Bitmap bmp)
    {
    Response.Write(bmp.Width.ToString());
    Response.Write(bmp.Height.ToString());
    }

    //shrink the image proportionately so that neither height nor width is more
    than [NewSize] pixels

    public System.Drawing.Image ShrinkImage(System.Drawing.Bitmap bmp, int
    NewSize)

    {

    double NewWidth;

    double NewHeight;

    double ShrinkPercent;

    System.Drawing.Image.GetThumbnailImageAbort myCallback =

    new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback);

    if (bmp.Width>bmp.Height)

    {

    NewWidth=NewSize;

    ShrinkPercent=(NewWidth/bmp.Width)*100;

    NewHeight=(ShrinkPercent/100)*bmp.Height;

    }

    else

    {

    NewHeight=NewSize;

    ShrinkPercent=(NewHeight/bmp.Height)*100;

    NewWidth=(ShrinkPercent/100)*bmp.Width;

    }

    System.Drawing.Image myShrunkenImage =
    bmp.GetThumbnailImage((int)NewWidth,(int)NewHeight,myCallback,IntPtr.Zero);

    return myShrunkenImage;

    }

    public bool ThumbnailCallback(){return false;}

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://SteveOrr.net


    "asad" <> wrote in message
    news:...
    > Hello friends, i have a directory in which my uploaded images are stored i
    > want to create thumnails of these images dynamically and show these
    > thumbnail
    > how can i do this pls tell me about that.
    > Thanks
    Steve C. Orr [MVP, MCSD], Apr 11, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Franco Gustavo

    OpenDialog and thumbnails

    Franco Gustavo, Aug 27, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    1,093
    Franco Gustavo
    Aug 27, 2003
  2. Chris D

    ASP.Net Thumbnails

    Chris D, Nov 17, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    3,214
  3. =?Utf-8?B?YXNhZA==?=

    ASP.NET Thumbnails

    =?Utf-8?B?YXNhZA==?=, Apr 12, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    517
    Brock Allen
    Apr 12, 2005
  4. Ray Booysen
    Replies:
    2
    Views:
    645
    Ray Booysen
    Mar 28, 2006
  5. Noozer
    Replies:
    13
    Views:
    5,517
    SpaceGirl
    Mar 15, 2005
Loading...

Share This Page