locked
creating an image resizer by C#.net RRS feed

  • Question

  • User1000038322 posted

    Hello everybody, can anyone help me to create an image resizer by c#.net

    Like, I have an image (100 X 100 pixels) . Now I want to resize this image by 50 X 50 pixels or 50 X 70 pixels according to my requirement. How can I create this resizer. Please help me.

    Saturday, March 20, 2010 8:34 AM

Answers

  • User-1812063630 posted

    Please go thrugh the following page

    http://aspxcode.somee.com/Tools/ImageResize.aspx

    download one dll file from this page and add it to your Bin Folder.

    run the following code as follows

    string srcpath = Server.MapPath("~" + "/images/logos.jpg");
    string despath = Server.MapPath("~" + "/images/logod.jpg");
    
    ResizeImage.ResizeImage.DoResize(srcpath , despath , 50, 50); 


    but please keep in mind provide the path use Server.MapPath function
    because it provides perfect image system path


    Please remember to click “Mark as Answer” on the post that helps you.

    This can be beneficial to other community members reading the thread.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, March 20, 2010 9:09 AM
  • User-1659704165 posted

    Hi,

    public Bitmap ResizeBitmap( Bitmap b, int nWidth, int nHeight )
    {
      Bitmap result = new Bitmap( nWidth, nHeight );
      using( Graphics g = Graphics.FromImage( (Image) result ) )
        g.DrawImage( b, 0, 0, nWidth, nHeight );
      return result;
    }

    or

    http://snippets.dzone.com/posts/show/4336

    chk the above link

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, March 20, 2010 10:41 AM

All replies

  • User-1812063630 posted

    Please go thrugh the following page

    http://aspxcode.somee.com/Tools/ImageResize.aspx

    download one dll file from this page and add it to your Bin Folder.

    run the following code as follows

    string srcpath = Server.MapPath("~" + "/images/logos.jpg");
    string despath = Server.MapPath("~" + "/images/logod.jpg");
    
    ResizeImage.ResizeImage.DoResize(srcpath , despath , 50, 50); 


    but please keep in mind provide the path use Server.MapPath function
    because it provides perfect image system path


    Please remember to click “Mark as Answer” on the post that helps you.

    This can be beneficial to other community members reading the thread.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, March 20, 2010 9:09 AM
  • User2102717516 posted

    Hi,

          Try this site

      http://webcropimage.codeplex.com/ 



    Regards

    Nageswaran

    Saturday, March 20, 2010 9:15 AM
  • User-1659704165 posted

    Hi,

    public Bitmap ResizeBitmap( Bitmap b, int nWidth, int nHeight )
    {
      Bitmap result = new Bitmap( nWidth, nHeight );
      using( Graphics g = Graphics.FromImage( (Image) result ) )
        g.DrawImage( b, 0, 0, nWidth, nHeight );
      return result;
    }

    or

    http://snippets.dzone.com/posts/show/4336

    chk the above link

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, March 20, 2010 10:41 AM
  • Wednesday, March 24, 2010 7:46 AM
  • User1542308116 posted

    check the examples below


    http://www.codeproject.com/KB/GDI-plus/imageresize.aspx

    http://snippets.dzone.com/posts/show/1485

    http://www.neodynamic.com/ND/FaqsTipsTricks.aspx?tabid=66&prodid=4&sid=71

    Wednesday, March 24, 2010 8:15 AM