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. Testing for current PictureBox.Image

Testing for current PictureBox.Image

Scheduled Pinned Locked Moved C#
databasetestingbeta-testingquestion
7 Posts 5 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.
  • K Offline
    K Offline
    kanchoette
    wrote on last edited by
    #1

    I am setting a PictureBox.Image to an ImageList index with summaryKeyEventsPictureBox.Image = keyEventIconsImageList.Images[2]; If I wanted to test if my current pictureBox image was equal to the ImageList.Images[2] how would I do this please?

    C S 0 3 Replies Last reply
    0
    • K kanchoette

      I am setting a PictureBox.Image to an ImageList index with summaryKeyEventsPictureBox.Image = keyEventIconsImageList.Images[2]; If I wanted to test if my current pictureBox image was equal to the ImageList.Images[2] how would I do this please?

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      There's no equals operator for images. The most effective way, is to store the index somewhere. Does the picturebox have a Tag property ?

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      1 Reply Last reply
      0
      • K kanchoette

        I am setting a PictureBox.Image to an ImageList index with summaryKeyEventsPictureBox.Image = keyEventIconsImageList.Images[2]; If I wanted to test if my current pictureBox image was equal to the ImageList.Images[2] how would I do this please?

        S Offline
        S Offline
        Sun Rays
        wrote on last edited by
        #3

        Hi, check this..[^] may it helps you :-O

        Thanks, Sun Rays To get something you must have to try once. My Articles

        C 1 Reply Last reply
        0
        • S Sun Rays

          Hi, check this..[^] may it helps you :-O

          Thanks, Sun Rays To get something you must have to try once. My Articles

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          This is pretty close to being totally unrelated to his question

          Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

          K L 2 Replies Last reply
          0
          • C Christian Graus

            This is pretty close to being totally unrelated to his question

            Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

            K Offline
            K Offline
            kanchoette
            wrote on last edited by
            #5

            He meant well. Anyway, my grateful thanks for all the replies.

            1 Reply Last reply
            0
            • K kanchoette

              I am setting a PictureBox.Image to an ImageList index with summaryKeyEventsPictureBox.Image = keyEventIconsImageList.Images[2]; If I wanted to test if my current pictureBox image was equal to the ImageList.Images[2] how would I do this please?

              0 Offline
              0 Offline
              0x3c0
              wrote on last edited by
              #6

              As an addendum to what CG was saying you could also save them to MemoryStreams and hash them. From there, it's a simple matter of comparing the byte arrays. I wouldn't personally use this method, I'm just including it for completeness' sake. I would do as CG said, and try to use the PictureBox's Tag property

              Between the idea And the reality Between the motion And the act Falls the Shadow

              1 Reply Last reply
              0
              • C Christian Graus

                This is pretty close to being totally unrelated to his question

                Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

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

                ROTFL :laugh:

                Luc Pattyn [Forum Guidelines] [My Articles]


                The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


                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