Best way to handle images.

Home Forums General Programming Best way to handle images.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #6059
    Bomma72
    Participant
      • Topics: 20
      • Replies: 68
      • Total: 88

      I am trying to have a separate control change images on the panel.  My question is what is the best way to do this?  Do I have to use layers or can I just use a property on the image control and change this property from the code behind?

      Also I have images that basically look like lights turning on and off.  So there are two images one for on and one for off.  My initial idea was to use the image button and then just toggle it to True and False from the code behind when a separate control gets to the appropriate setting. This works find except the user can still just click on the image button and change the image.  So my second question is there a way to lock the button from being changed with a click event so that it only works from the code behind.   I even tried putting this image button on separate bottom layer but that didn’t work because you can still access it.

      I should note I am using the older version of Ctrlr for the time being waiting for the next release on mac.

       

      #6061
      dasfaker
      Keymaster
        • Topics: 80
        • Replies: 793
        • Total: 873
        • ★★★

        I am trying to have a separate control change images on the panel. My question is what is the best way to do this? Do I have to use layers or can I just use a property on the image control and change this property from the code behind?

        If you want to change the image of a uiImage component just use
        panel:getModulatorByName(“your uiImage modulator”):getComponent():setPropertyString(“uiImageResource”,”the new image you want to put”)

        For the second question, if you don’t want user interaction with the element, use a uiImage and follow the instructions above.

        #6124
        Bomma72
        Participant
          • Topics: 20
          • Replies: 68
          • Total: 88

          OK,

          How about with a repeating type image made in Knobman.  The reason I ask is I am trying to do a kind of a meter to show the level of something.  I designed the image with Knobman so if I were to use it I would have to change the positions.  Maybe there are properties for this as well?  My original plan was to just use a slider, lock it down and set the value from the code behind, but from your post that doesn’t seem possible.

           

          #6125
          dasfaker
          Keymaster
            • Topics: 80
            • Replies: 793
            • Total: 873
            • ★★★

            I don’t say isn’t possible. In fact it is, and the best way is using a uiImageSlider as you suggest.

            It all depends of what you want to do. To make a “on/off” image switch is better to use uiImage, for multiple image change is better a uiImageSlider

            #6126
            atom
            Keymaster
              • Topics: 159
              • Replies: 2945
              • Total: 3104
              • ★★★★★

              Well looks like i missed the “Component is disabled” property will add it asap, and you’ll be able to use Sliders as Displays.

              #6127
              Bomma72
              Participant
                • Topics: 20
                • Replies: 68
                • Total: 88

                Wow great.  That makes it very easy.

                Sorry dasfaker shouldn’t assumed you meant it was impossible.   By the way atom, as someone who works with VB, C#, CSS, Java, and HTML all day, you have made some pretty excellent software.  This is quite an effort and very well executed I might add.  Thanks again.

              Viewing 6 posts - 1 through 6 (of 6 total)
              • The forum ‘Programming’ is closed to new topics and replies.
              There is currently 0 users and 64 guests online
              No users are currently active
              Forum Statistics
              Threads: 2,495, Posts: 17,374, Members: 77,605
              Most users ever online was 12 on January 22, 2019 3:47 pm
              Ctrlr