ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

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

COW Forums : Adobe After Effects Expressions

<< 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 12:16:43 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

Andrei Popa
Re: Is it possible to embed images in ScriptGUI by using the ressource string method?
on Dec 26, 2019 at 2:04:12 pm

I don't know how to add images using resource string but i recommend you change your way of creating dockable GUI.

Here is a link to one of my Dropbox Paper documents.
I haven't got the time to post it on my website, so it lack images, but you can fully understand even without them. About 3 minutes read.


Here is the link https://paper.dropbox.com/doc/GUI-using-website-httpsscriptui.joonas.me--Ar...

Andrei
My Envato portfolio.


Return to posts index

Adirai Maji
Re: Is it possible to embed images in ScriptGUI by using the ressource string method?
on Dec 27, 2019 at 4:36:10 pm

Thank you sir...


Return to posts index

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