0 Replies Latest reply on Sep 3, 2010 11:43 PM by kumar1981

    [CS3][JS]Script UI : Draw Image in a window object

    kumar1981

      Hi,

       

        I have tried the following code to add background image for window object. But it throws "cannot execute" error.

       

       

      var dlg = new Window('dialog', 'Test');

      var g = dlg.graphics;

      g.drawImage( ScriptUI.newImage(File("c:/dialog.png") ),10, 10 );
      dlg.show();

       

      Is this correct?

       

      and also I have tried the following code. It displays window without image(empty)

       

      var dlg = new Window('dialog', 'Test');

      dlg.preferredSize=[300,100];

      dlg.onDraw=function(){

            var g = dlg.graphics;

           g.drawImage(ScriptUI.newImage(File("c:/dialog.png") ),10, 10);

      }
      dlg.show();

       

       

      Is there any other way? Suggest me.

       

       

       

       

       

      Regards

      kumar

       

      Message was edited by: kumar1981

       

      Message was edited by: kumar1981