Home Image-Pro Automation (Macros, Apps, Reports)

ICON for BUTTON1.IMAGE . . .

2018-09-13-150246

All --

In DESIGN / EDIT MODE I know how to change the IMAGE shown on a BUTTON in an APP.  This is shown below



I believe this can be done while the APP is running.

Specifically . . .

If I have a button called

    button_capture

and I want this button to the CAPTURE IMAGE (with the CAPTURE / IRIS icon) sometimes and the RECORD MOVIE (with RECORD / RED CIRCLE icon) depending on the state of some RADIO BUTTONS.  I want this button to be as similar to the CAPTURE and RECORD buttons in the CAPTURE WINDOW (below) as possible.



I can change the BUTTON TEXT as shown below.




I would like to know how to change the IMAGE in the BUTTON using CODE.

I assume it is something like

    button_capture.image = AAA ( BBB, CCC, DDD)

but I do not have enough information to determine what AAA, BBB, CCC, or DDD are.  I think AAA might be GETIMAGE but I am not sure.

Would someone help here please?

Thanks.

-- Matt






Best Answers

  • Answer ✓
    Hi Matt,

    One of the solutions is that you can create ImageList with 2 images in your dialog, assign this image list to the button
    The code in designer.vb:
                Me.buttonLive.ImageIndex = 2
                Me.buttonLive.ImageList = Me.imageList1

    and then control ImageIndex in your macro:

                If AppModule.IsPreviewing Then
                    buttonLive.ImageIndex=1
                Else
                    buttonLive.ImageIndex=2
                End If


    Yuri
  • Answer ✓
    Here is the screenshot of the designer

    and sample app

    Yuri

Answers

  • 2018-09-13-160756

    Yuri --

    I was able to get the IMAGELIST CONTROL working.

    To do so I

    • Exported the DEPENDENCIES from the APP your IPX FILE
    • Imported the DEPENDENCIES into my APP in my IPP FILE
    • Added IMAGELIST1 to my APP
    • Created 32 x 32 BMP FILES with the ICONS I wanted
    • Added the BMP FILES to the IMAGELIST CONTROL
    • Added the IMAGELIST to the BUTTON
    • Set the INDEX in the CODE
    The result works well as shown below.



    Thank you for your assistance.

    I was hoping to use the BUTTONX.IMAGE property and reference the ICONS already in the DLL but this method opens some other doors.

    Thanks.

    -- Matt

Sign In or Register to comment.