Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Is it possible to embed images in ScriptGUI by using the ressource string method?

  • Is it possible to embed images in ScriptGUI by using the ressource string method?

    Posted by Adirai Maji on December 23, 2019 at 11:54 am

    Dear script developers,

    I’m trying to embed graphics in my UI. I would like to make Dockable GUI. To build the UI, I use the ressource string method. But I still can’t figure how to embed graphics in the layout.

    Here is what I’ve tried:

    {
    function myScript(thisObj) {
    function myScript_buildUI(thisObj) {
    var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "My Panel Name", [0, 0, 300, 300]);

    var myIcon = "\u0089PNG\r\n\x1A\n\x00 etc etc"; //this is where I paste the image data

    res="group{orientation:'row', alignment:['left', 'top'], alignChildren:['center', 'center'],\
    myPanel1: Panel{text:'Panel1 Name', orientation:'column', alignChildren:['center', 'center'],\
    myPanelItem1: IconButton{image:'"+myIcon+"'},\
    },\
    },\
    }";

    myPanel.grp = myPanel.add(res);
    myPanel.grp.myPanel1.myPanelItem1.onClick = function(){alert('yo')};
    myPanel.layout.layout(true);
    myPanel.grp.minimumSize = myPanel.grp.size;
    myPanel.layout.resize();
    myPanel.onResizing = myPanel.onResize = function () {this.layout.resize();}
    return myPanel;
    }
    var myScriptPal = myScript_buildUI(thisObj);
    if ((myScriptPal != null) && (myScriptPal instanceof Window)) {
    myScriptPal.center();
    myScriptPal.show();
    }
    }
    myScript(this);
    }

    Is there a way to make this works or should I forget about the ressource string method to put images in my GUI?

    ==================================================================================================
    Thanks in Advance…

    – Adirai Maji

    Adirai Maji replied 6 years, 4 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy