Home AMX User Forum NetLinx Studio

How to change a button image

On my panel i have a button with 1.jpg on off state bittmap and 2.jpg on on state bittma, I want changes оff bittmaps before one click on this button. Sorry for bad english

Comments

  • adysadys Posts: 395
    you can do it in 2 ways:

    The first is to make your button a "multi-state-general" button instead of a general button. This way you can add states to your button, in your case 3 states.

    You will have to change the states with the ANI command:

    Syntax:
    "'^ANI-<vt addr range>,<start state>,<end state>,<time>'"
    Variable:
    variable text address range = 1 - 4000.
    start state = Beginning of button state (0= current state).
    end state = End of button state.
    time = In 1/10 second intervals.
    Example:
    SEND_COMMAND Panel,"'^ANI-500,1,25,100'"
    Runs a button animation at text range 500 from state 1 to state 25 for 10 second.


    The second way is to change the image for state "off" with the ^BMP command, but I don't think its a recomended way(in my opinion its a bit too complex to such a simple use)
  • viningvining Posts: 4,368
    Try this thread! Joe has good example of the ^ANI command and there's some info on the the use of multi state bargraphs which can be used as an alternate method or as some suggest the preffered method. I use them both depending on the circumstance but if there is no need for animation as well as set states I Iean towards the multi state bar graph because it's a little simpler.
Sign In or Register to comment.