image resizing

Last post 07-04-2009 9:04 AM by rathima. 7 replies.

Sort Posts:

  • image resizing

    06-10-2009, 5:08 PM
    • Member
      2 point Member
    • j2flk
    • Member since 04-17-2008, 10:55 PM
    • Posts 33

    Hi,

    In my web app i'm uploading pictures of employees and I need to resize the images while maintaining the same quality.  The best example I can think of is the way facebook does their image resizing.  When you upload a profile picture...the picture shown in your profile page isn't the full size...i tried to find an algorithm that would work but am having no luck. 

     Any ideas?

     Thanks

  • Re: image resizing

    06-11-2009, 2:09 AM

     private string createthumbnail(string originalimage, int resizewidth, int resizeheight)
        {

            string ImgThumb ="path you like to save"    
            string imgFileName = System.IO.Path.GetFileName(originalimage);
            System.Drawing.Image myimg = System.Drawing.Image.FromFile(originalimage);
            myimg = myimg.GetThumbnailImage(resizewidth, resizeheight, null, IntPtr.Zero);
            myimg.Save(ImgThumb + imgFileName, myimg.RawFormat);
            string path = ImgThumb + imgFileName;
            return path;
        }

  • Re: image resizing

    06-11-2009, 2:18 AM
    • Star
      10,971 point Star
    • chintanpshah
    • Member since 11-19-2008, 5:39 AM
    • Ahmedabad
    • Posts 1,959
  • Re: image resizing

    06-11-2009, 3:47 AM
    • Member
      3 point Member
    • AlexWD
    • Member since 05-12-2009, 7:36 AM
    • Posts 5

    Hello j2flk,

    Here is one of the best solutions I could find on the Internet.

    http://www.codeproject.com/KB/GDI-plus/imageresize.aspx?display=Print 

    Also, please check my thread http://forums.asp.net/t/1433678.aspx . If you implement this solution and you find a resolution for my problem, please post it on my thread. Good luck!

     

  • Re: image resizing

    06-11-2009, 3:47 PM
    • Member
      2 point Member
    • j2flk
    • Member since 04-17-2008, 10:55 PM
    • Posts 33

    Hey Guys,

    Thanks for your help....i'm just going to go with a solution I found in ASP.NET 3.5 Social Networking....it's a pretty simple solution but if anyone is curious as to what it is then just let me know and i'll post it.

     One problem I am encountering however is that I want to resize on the fly....the problem with this is that to display my image i'm using asp Image.  My algorithm creates a bitmap however...and i don't know how I can assign this bitmap to the asp image.  Any ideas?

  • Re: image resizing

    06-12-2009, 2:55 PM
    Answer
    • Star
      10,971 point Star
    • chintanpshah
    • Member since 11-19-2008, 5:39 AM
    • Ahmedabad
    • Posts 1,959

    If your algorithm stores it with name "test.jpg" in image folder then use:

    Image1.ImageURL = "~/image/test.jpg"

    Hope this helps...

    Don't forget to mark as answer, if it helps
  • Re: image resizing

    06-15-2009, 8:09 AM
    • Contributor
      2,136 point Contributor
    • oidldb
    • Member since 05-27-2009, 9:46 AM
    • Romania
    • Posts 400

     Hi j2flk,

     

    Can you post your simple solution. I am trying ro resize an image according to the size of the browser window. Maybe it can help

     

    Thanks and regards,

    Dani

    Thank you and regards,
    Dani

    P.S. Please mark as answer if this helps.
  • Re: image resizing

    07-04-2009, 9:04 AM
    • Member
      2 point Member
    • rathima
    • Member since 07-04-2009, 8:51 AM
    • Posts 1

    j2flk:

    Hi,

    In my web app i'm uploading pictures of employees and I need to resize the images while maintaining the same quality.  The best example I can think of is the way facebook does their image resizing.  When you upload a profile picture...the picture shown in your profile page isn't the full size...i tried to find an algorithm that would work but am having no luck. 

     Any ideas?

     Thanks

     

     

    There is a great site for resizing your images without affecting the quality of the image. It is: http://www.reshade.com . You can Enhance, crop and resize images for free with the high quality online image resizer.

    The Photo Enlargement Software at this site is the most accurate photo enlargement method for your PC. It would sure give you a Best quality image resizing, better than photoshop or other tools. Compared to other photo enlargers on the market Reshade works best at any zoom not only specific ranges (1x-4x, 3x-5x etc).

    You can check it out at: http://www.reshade.com

     

Page 1 of 1 (8 items)