FORUMS: list search recent posts

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

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Adirai Maji
Is it possible to embed images in ScriptGUI by using the ressource string method?
on Dec 23, 2019 at 11:54:57 am
Last Edited By Adirai Maji on Dec 23, 2019 at 12:14:31 pm

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


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]