Quantcast
Channel: Adobe Community : Discussion List - After Effects Scripting
Viewing all articles
Browse latest Browse all 2143

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

$
0
0

Dear script developers,

 

I’m trying to embed graphics in my UI. So far I’ve tryed the method described by Peter Kahrel in appendix 1 of his ScriptUI For Dummies, and it works for floating GUI.

But I would like to make Dockable GUI. To build the UI, I use the ressource string method that I’ve found on this forum (many thanks to David Torno) but I still can’t figure how to embed graphics in the layout.

Here is what I’ve tryed:

 

{

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?


Viewing all articles
Browse latest Browse all 2143

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>