Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. resize image in asp.net

resize image in asp.net

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nettutorial
7 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    trilokharry
    wrote on last edited by
    #1

    Hi how to resize image in asp.net. thanks

    You get the best out of others when you give the best of yourself.

    B P M 3 Replies Last reply
    0
    • T trilokharry

      Hi how to resize image in asp.net. thanks

      You get the best out of others when you give the best of yourself.

      B Offline
      B Offline
      Brij
      wrote on last edited by
      #2

      Have a look to the Link

      Cheers!! Brij My Latest Article :Exploring ASP.NET Validators

      1 Reply Last reply
      0
      • T trilokharry

        Hi how to resize image in asp.net. thanks

        You get the best out of others when you give the best of yourself.

        P Offline
        P Offline
        PSK_
        wrote on last edited by
        #3

        1- If you want to resize the image just for display then you can set the width and height of the image as required. 2- If you want it be interactive, so that client can resize the image then I will prefer some jquery plugin to do this task. Check this out http://plugins.jquery.com/taxonomy/term/2532[^] 3- If you want to do this at server side then using the GDI+ you can resize the image. Check this Resizing a Photographic image with GDI+ for .NET[^]

        Regards, Prakash Kalakoti

        T 1 Reply Last reply
        0
        • P PSK_

          1- If you want to resize the image just for display then you can set the width and height of the image as required. 2- If you want it be interactive, so that client can resize the image then I will prefer some jquery plugin to do this task. Check this out http://plugins.jquery.com/taxonomy/term/2532[^] 3- If you want to do this at server side then using the GDI+ you can resize the image. Check this Resizing a Photographic image with GDI+ for .NET[^]

          Regards, Prakash Kalakoti

          T Offline
          T Offline
          trilokharry
          wrote on last edited by
          #4

          I need to resize and want to save in disc so pixel quality will be maintained. thanks

          You get the best out of others when you give the best of yourself.

          P 1 Reply Last reply
          0
          • T trilokharry

            I need to resize and want to save in disc so pixel quality will be maintained. thanks

            You get the best out of others when you give the best of yourself.

            P Offline
            P Offline
            PSK_
            wrote on last edited by
            #5

            Then explore the 3rd option, you will find some example in the article which scales the image by fixed size of percentage.

            Regards, Prakash Kalakoti

            T 1 Reply Last reply
            0
            • P PSK_

              Then explore the 3rd option, you will find some example in the article which scales the image by fixed size of percentage.

              Regards, Prakash Kalakoti

              T Offline
              T Offline
              trilokharry
              wrote on last edited by
              #6

              It's resizing image but no quality in image like in 800*600 dimension. thanks

              You get the best out of others when you give the best of yourself.

              1 Reply Last reply
              0
              • T trilokharry

                Hi how to resize image in asp.net. thanks

                You get the best out of others when you give the best of yourself.

                M Offline
                M Offline
                Mehdi Ghiasi
                wrote on last edited by
                #7

                This Function Can help you! :-D

                Public Function ResizePicture(ByVal sourceImage As Bitmap, ByVal newSize As Size) As Bitmap
                
                    Dim Result\_image As New Bitmap(sourceImage, newSize.Width, newSize.Height)
                    Dim Gr As Graphics
                
                    Gr = Graphics.FromImage(Result\_image)
                    Gr.DrawImage(Result\_image, 0, 0, newSize.Width, newSize.Height)
                    Gr.Save()
                
                    Return Result\_image
                End Function
                

                Then you can save the output of this Function By using ResizePicture(MyBitmap, New Size(100, 100)).Save(MapPath("/") & "/Images/MyImage.png", Imaging.ImageFormat.Png) Note: These codes are in VB.NET Language, but you can simply convert it to C# or any .NET language

                Regards. Mehdi Ghiasi

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups