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. General Programming
  3. C#
  4. problem in saving an image in windows application

problem in saving an image in windows application

Scheduled Pinned Locked Moved C#
graphicshelp
5 Posts 3 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.
  • A Offline
    A Offline
    Arun kumar Gautam
    wrote on last edited by
    #1

    Hello to all guys, I am having a problem in windows application I have a button through which i can select an image using openfiledialog and thn after the path of the selected image is shown in another textbox but after tht m wanna to save tht save into another fold using savefiledialog but i cant do it for save an image i use this code Bitmap bit = new Bitmap(saveFileDialog1.FileName); bit.Save(saveFileDialog1.FileName, System.Drawing.Imaging.ImageFormat.Jpeg); but it doesnt work can anyone help in it

    L A 2 Replies Last reply
    0
    • A Arun kumar Gautam

      Hello to all guys, I am having a problem in windows application I have a button through which i can select an image using openfiledialog and thn after the path of the selected image is shown in another textbox but after tht m wanna to save tht save into another fold using savefiledialog but i cant do it for save an image i use this code Bitmap bit = new Bitmap(saveFileDialog1.FileName); bit.Save(saveFileDialog1.FileName, System.Drawing.Imaging.ImageFormat.Jpeg); but it doesnt work can anyone help in it

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Arun kumar Gautam wrote:

      but it doesnt work

      You need to tell us exactly what that means. However:

      Bitmap bit = new Bitmap(saveFileDialog1.FileName);
      bit.Save(saveFileDialog1.FileName, System.Drawing.Imaging.ImageFormat.Jpeg);

      Are you sure you want to create the Bitmap from the filename in the SaveFileDialog?

      Use the best guess

      A 1 Reply Last reply
      0
      • L Lost User

        Arun kumar Gautam wrote:

        but it doesnt work

        You need to tell us exactly what that means. However:

        Bitmap bit = new Bitmap(saveFileDialog1.FileName);
        bit.Save(saveFileDialog1.FileName, System.Drawing.Imaging.ImageFormat.Jpeg);

        Are you sure you want to create the Bitmap from the filename in the SaveFileDialog?

        Use the best guess

        A Offline
        A Offline
        amit29391
        wrote on last edited by
        #3

        Bitmap bit = new Bitmap(openFileDialog1.FileName); bit.Save(saveFileDialog1.FileName); and for saving it as jpg you can either add extension while giving it name in save file dialog or you can add filter in property window of save file dialog under filter property add JPeg Image|*.jpg

        L 1 Reply Last reply
        0
        • A amit29391

          Bitmap bit = new Bitmap(openFileDialog1.FileName); bit.Save(saveFileDialog1.FileName); and for saving it as jpg you can either add extension while giving it name in save file dialog or you can add filter in property window of save file dialog under filter property add JPeg Image|*.jpg

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Why are you telling me this?

          Use the best guess

          1 Reply Last reply
          0
          • A Arun kumar Gautam

            Hello to all guys, I am having a problem in windows application I have a button through which i can select an image using openfiledialog and thn after the path of the selected image is shown in another textbox but after tht m wanna to save tht save into another fold using savefiledialog but i cant do it for save an image i use this code Bitmap bit = new Bitmap(saveFileDialog1.FileName); bit.Save(saveFileDialog1.FileName, System.Drawing.Imaging.ImageFormat.Jpeg); but it doesnt work can anyone help in it

            A Offline
            A Offline
            amit29391
            wrote on last edited by
            #5

            Bitmap bit = new Bitmap(openFileDialog1.FileName); bit.Save(saveFileDialog1.FileName); and for saving it as jpg you can either add extension while giving it name in save file dialog or you can add filter in property window of save file dialog under filter property add JPeg Image|*.jpg

            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