adding images to Script UI for photoshop
I would like to add images to my scripted UI's for Photoshop.
After allot of trail and error, I managed to get a few results working within ExtendScript.
But when I tried it in photoshop, it didn't work correctly.
What I found out was that for some reason I can only get an image to show in photoshop when it's a .png file, jpg's do not work, only in extendScript.
Also, the png images didn't scale at all, but again, it does work in extendScript.
Here is the code, with 5 different ways to add the same image...
var window = new Window ("dialog", "image test", undefined);
window.add('image', {x:100, y:50, width:50, height:50}, 'C://1.png');
window.add('image', undefined, 'C://1.png');
var imageFile = new File ("C://1.png");
var testImage = window.add("image", {x:25,y:0,width:50,height:50}, imageFile);
var imageFile = new File ("C://1.png");
var testImage = window.add("image", [0,0,200,200], imageFile);
var imageFile = new File ("C://1.png");
var testImage = window.add("image", undefined, imageFile);
testImage.size =[200,200];
window.show();
When you run this script in extendScript, it shows 3 small images on top, and than 2 big ones, like I would expect.
But in Photoshop they are all small, so scaling doesn't work, but the dialog window does increase in size.
I believe here is also another way to place images, but I haven't been able to find an example, but it starts with..
var imageFile = new File ("C://1.png");
var testImage = ScriptUI.newImage (imageFile, imageFile, imageFile, imageFile)
and then a drawImage command, something like this...
ScriptUI.Graphics.drawImage (testImage, [0,0,50,50]);
But could not get it working, (undefined is not an object) also in extendscript, I'm missing simple examples here.
But I also would like to know if I can get jpg's to work in photoshop.
Any advice is highly appreciated!
