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. To Change an Image into different formats?

To Change an Image into different formats?

Scheduled Pinned Locked Moved ASP.NET
questioncsharpdotnet
3 Posts 2 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.
  • M Offline
    M Offline
    MudkiSekhon
    wrote on last edited by
    #1

    I want to change an image to different sizes and then store it. I have an image of normal size and I want to create Thumbnail and Enlarges Image of this image and store them. How can I do it using classes in .NET framework? Thanks, Sandy

    R 1 Reply Last reply
    0
    • M MudkiSekhon

      I want to change an image to different sizes and then store it. I have an image of normal size and I want to create Thumbnail and Enlarges Image of this image and store them. How can I do it using classes in .NET framework? Thanks, Sandy

      R Offline
      R Offline
      R Prabha Devi
      wrote on last edited by
      #2

      Hi, Below code for image resizing and saving in C#

      System.Drawing.Image imgResize;
      System.Drawing.Image tempImage;

      string strPath;

      strPath = "c:/personal/test.jpg";

      imgResize = System.Drawing.Image.FromFile(strPath);
      //Below code reducing the image width and height to increase u can multiply with numerals
      tempImage = new Bitmap(imgResize,imgResize.Width / 3, imgResize.Height / 3);

      string strFilePath = "newfolderpath/imagename.jpg";

      tempImage.Save(strFilePath,ImageFormat.Jpeg);

      Hope this helps u...:)

      M 1 Reply Last reply
      0
      • R R Prabha Devi

        Hi, Below code for image resizing and saving in C#

        System.Drawing.Image imgResize;
        System.Drawing.Image tempImage;

        string strPath;

        strPath = "c:/personal/test.jpg";

        imgResize = System.Drawing.Image.FromFile(strPath);
        //Below code reducing the image width and height to increase u can multiply with numerals
        tempImage = new Bitmap(imgResize,imgResize.Width / 3, imgResize.Height / 3);

        string strFilePath = "newfolderpath/imagename.jpg";

        tempImage.Save(strFilePath,ImageFormat.Jpeg);

        Hope this helps u...:)

        M Offline
        M Offline
        MudkiSekhon
        wrote on last edited by
        #3

        thanx for the reply..... It worked for resizing he images Thanks, Sandy

        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