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. How to select right size icon from imagelist with multiple resolution icons

How to select right size icon from imagelist with multiple resolution icons

Scheduled Pinned Locked Moved C#
tutorialquestion
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.
  • S Offline
    S Offline
    shultas
    wrote on last edited by
    #1

    Hello Everyone- I have an imagelist that I have added .ico files into. The icons have multiple resolutions. I am trying to use one imagelist for multiple roles in my application. I set the default size to be 32,32. The places in the application where I set the image of the picturebox or a large button to an image in the imagelist, it works fine. But there are times when I want to only use a 16,16 icon, say in the treeview. When I set the icon of the node to the image in the imagelist, it is using the default size which is 32,32. I've tried setting the size on the fly of the imagelist, such as imageListStatus = new Size(16,16), but that appears to delete all of the images out of the list. Is there any way to use multiple resolutions out of an imagelist that is containing icons with many sizes? TIA!

    S 1 Reply Last reply
    0
    • S shultas

      Hello Everyone- I have an imagelist that I have added .ico files into. The icons have multiple resolutions. I am trying to use one imagelist for multiple roles in my application. I set the default size to be 32,32. The places in the application where I set the image of the picturebox or a large button to an image in the imagelist, it works fine. But there are times when I want to only use a 16,16 icon, say in the treeview. When I set the icon of the node to the image in the imagelist, it is using the default size which is 32,32. I've tried setting the size on the fly of the imagelist, such as imageListStatus = new Size(16,16), but that appears to delete all of the images out of the list. Is there any way to use multiple resolutions out of an imagelist that is containing icons with many sizes? TIA!

      S Offline
      S Offline
      Saksida Bojan
      wrote on last edited by
      #2

      My suggestion is, create 2 image list, one with 32x32 size and other with 16x16

      S 1 Reply Last reply
      0
      • S Saksida Bojan

        My suggestion is, create 2 image list, one with 32x32 size and other with 16x16

        S Offline
        S Offline
        shultas
        wrote on last edited by
        #3

        Thank you very much! I was just making sure this was the "proper" way of doing things!

        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