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. pictureBox.image default (no picture)

pictureBox.image default (no picture)

Scheduled Pinned Locked Moved C#
question
6 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.
  • R Offline
    R Offline
    Rapier503
    wrote on last edited by
    #1

    Hi, I setting pictureBox.image = Image.FromFile("eweew.bmp"); This works file, but at times I want no picture to be displayed. How do I set pictureBox.image to no value or default? Thanks in advance. Rapier

    G 1 Reply Last reply
    0
    • R Rapier503

      Hi, I setting pictureBox.image = Image.FromFile("eweew.bmp"); This works file, but at times I want no picture to be displayed. How do I set pictureBox.image to no value or default? Thanks in advance. Rapier

      G Offline
      G Offline
      Giorgi Dalakishvili
      wrote on last edited by
      #2

      Try setting it to null. Edited: Don't forget to dispose the image before clearing it.

      #region signature my articles #endregion

      modified on Friday, January 04, 2008 7:55:36 AM

      L R 2 Replies Last reply
      0
      • G Giorgi Dalakishvili

        Try setting it to null. Edited: Don't forget to dispose the image before clearing it.

        #region signature my articles #endregion

        modified on Friday, January 04, 2008 7:55:36 AM

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        Giorgi Dalakishvili wrote:

        Try setting it to null

        will it throw an exception?

        Luc Pattyn [Forum Guidelines] [My Articles]


        Happy 2008!


        G 1 Reply Last reply
        0
        • L Luc Pattyn

          Giorgi Dalakishvili wrote:

          Try setting it to null

          will it throw an exception?

          Luc Pattyn [Forum Guidelines] [My Articles]


          Happy 2008!


          G Offline
          G Offline
          Giorgi Dalakishvili
          wrote on last edited by
          #4

          No, It won't.

          #region signature my articles #endregion

          1 Reply Last reply
          0
          • G Giorgi Dalakishvili

            Try setting it to null. Edited: Don't forget to dispose the image before clearing it.

            #region signature my articles #endregion

            modified on Friday, January 04, 2008 7:55:36 AM

            R Offline
            R Offline
            Rapier503
            wrote on last edited by
            #5

            null works thank! I actually thought I had tried that. Rapier

            G 1 Reply Last reply
            0
            • R Rapier503

              null works thank! I actually thought I had tried that. Rapier

              G Offline
              G Offline
              Giorgi Dalakishvili
              wrote on last edited by
              #6

              Great! Make sure you dispose the image if you don't want to have memory leaks.

              #region signature my articles #endregion

              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