No announcement yet.

Resizing button at runtime

  • Filter
  • Time
  • Show
Clear All
new posts

  • Resizing button at runtime


    I have a quick question concerning the userButtons I use in my project.
    I would like to know if there is any way to adjust their size during runtime ?

    I am working on a project where the user can save up to 8 memories. If only 3 memories are used, it is only necessary to show these 3 buttons.

    - I need to adjust the location of the buttons to have a nice looking screen : I recently discovered the img_SetPosition() that works like a charm.
    - Since there is more space available on the display when only 3 buttons are shown, it would be nice to be able to scale them.

    Is there any way to scale / resize a button during runtime ?

    I tried the following, but I get a crazy pixel mapping of my initial button.
    img_SetWord(hndl, MY_BUTTON, IMAGE_HEIGHT, 100);
    img_SetWord(hndl, MY_BUTTON, IMAGE_WIDTH, 100);

  • #2

    No you won't be able to scale / resize the button during runtime. The only way around this is to make some additional buttons on the SD card that have different dimensions and switch them in when needed.

    Best regards



    • #3
      Thanks for your quick response Paul. Unfortunately, the answer I was expecting.

      I thought about the extra button with different sizes, but it will be a bit overkill for the project I am working on right now.
      I'll keep the solution for futur projects.