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. Picture Box

Picture Box

Scheduled Pinned Locked Moved C#
tutorial
8 Posts 3 Posters 1 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
    Member 378869
    wrote on last edited by
    #1

    :confused:How to load an image from a url into a PictureBox. Thank's

    M J 2 Replies Last reply
    0
    • M Member 378869

      :confused:How to load an image from a url into a PictureBox. Thank's

      M Offline
      M Offline
      Mazdak
      wrote on last edited by
      #2

      You have to save it as a Bitmap,then set the Image property of PictureBox to it.Something like this: picturebox.Image = Bitmap.FromFile(urlpath); Mazy No sig. available now.

      J 1 Reply Last reply
      0
      • M Member 378869

        :confused:How to load an image from a url into a PictureBox. Thank's

        J Offline
        J Offline
        joan_fl
        wrote on last edited by
        #3

        string sURL="www.MomComputerGeek.com"; System.Web.HttpRequest objRequest = new HttpRequest("",sURL,""); Stream objStream = objRequest.InputStream; PictureBox1.Image.FromStream(objStream); ------------------------------- Joan MomComputerGeek.com

        M 2 Replies Last reply
        0
        • M Mazdak

          You have to save it as a Bitmap,then set the Image property of PictureBox to it.Something like this: picturebox.Image = Bitmap.FromFile(urlpath); Mazy No sig. available now.

          J Offline
          J Offline
          joan_fl
          wrote on last edited by
          #4

          Damn.. yours is much nicer than what I posted! :sigh: ------------------------------- Joan MomComputerGeek.com

          M 1 Reply Last reply
          0
          • J joan_fl

            Damn.. yours is much nicer than what I posted! :sigh: ------------------------------- Joan MomComputerGeek.com

            M Offline
            M Offline
            Mazdak
            wrote on last edited by
            #5

            :) Mazy No sig. available now.

            1 Reply Last reply
            0
            • J joan_fl

              string sURL="www.MomComputerGeek.com"; System.Web.HttpRequest objRequest = new HttpRequest("",sURL,""); Stream objStream = objRequest.InputStream; PictureBox1.Image.FromStream(objStream); ------------------------------- Joan MomComputerGeek.com

              M Offline
              M Offline
              Member 378869
              wrote on last edited by
              #6

              Thank you for the Code, it's right BUT I'm not using ASP.NET I'm using Windows Forms and the class System.Web.HttpRequest is not valid. Do yuo know how in Windows Forms (Windows Application).

              J 1 Reply Last reply
              0
              • J joan_fl

                string sURL="www.MomComputerGeek.com"; System.Web.HttpRequest objRequest = new HttpRequest("",sURL,""); Stream objStream = objRequest.InputStream; PictureBox1.Image.FromStream(objStream); ------------------------------- Joan MomComputerGeek.com

                M Offline
                M Offline
                Member 378869
                wrote on last edited by
                #7

                I find this code: string sURL="http://localhost:8080/cercalia/img/dispositius\_home.gif"; System.Net.WebClient RequestURI = new System.Net.WebClient(); System.IO.Stream objStream = RequestURI.OpenRead(sURL); pictureBox1.Image = Bitmap.FromStream(objStream); This Code Works OK. Thank you for all.

                1 Reply Last reply
                0
                • M Member 378869

                  Thank you for the Code, it's right BUT I'm not using ASP.NET I'm using Windows Forms and the class System.Web.HttpRequest is not valid. Do yuo know how in Windows Forms (Windows Application).

                  J Offline
                  J Offline
                  joan_fl
                  wrote on last edited by
                  #8

                  Josep Restoy wrote: class System.Web.HttpRequest is not valid I think you would just need to reference the System.Web library. ------------------------------- Joan MomComputerGeek.com

                  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