# Creating Image Component though a script

**URL:** <https://forum.inductiveautomation.com/t/creating-image-component-though-a-script/5367>\
**Category:** Ignition\
**Created:** [November 1, 2012, 7:48pm UTC](https://forum.inductiveautomation.com/t/creating-image-component-though-a-script/5367 "2012-11-01T19:48:16Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![njsd](https://avatars.discourse-cdn.com/v4/letter/n/54ee81/32.png) [@njsd](https://forum.inductiveautomation.com/u/njsd)\
**Post date:** [November 1, 2012, 7:48pm UTC](https://forum.inductiveautomation.com/t/creating-image-component-though-a-script/5367/1 "2012-11-01T19:48:16Z")

</div>

Is there a scripting method for creating new image components and placing them in windows?

I can’t seem to find an appropriate method

---

<div class="post-metadata">

**Author:** ![Robert](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@Robert](https://forum.inductiveautomation.com/u/Robert)\
**Post date:** [November 1, 2012, 8:40pm UTC](https://forum.inductiveautomation.com/t/creating-image-component-though-a-script/5367/2 "2012-11-01T20:40:15Z")

</div>

Unless something has changed you can’t do that.

Two options: place all the components you expect on the screen and then hide/show them through scripting or, if you really need dynamic screens, use the paintable canvas and go nuts with java2D

---

<div class="post-metadata">

**Author:** ![njsd](https://avatars.discourse-cdn.com/v4/letter/n/54ee81/32.png) [@njsd](https://forum.inductiveautomation.com/u/njsd)\
**Post date:** [November 2, 2012, 3:49pm UTC](https://forum.inductiveautomation.com/t/creating-image-component-though-a-script/5367/3 "2012-11-02T15:49:50Z")

</div>

I thought there might not be a method, but one can hope.

---

<div class="post-metadata">

**Author:** ![James.Lorenz](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/james.lorenz/32/3290_2.png) [@James.Lorenz](https://forum.inductiveautomation.com/u/James.Lorenz)\
**Post date:** [November 2, 2012, 6:25pm UTC](https://forum.inductiveautomation.com/t/creating-image-component-though-a-script/5367/4 "2012-11-02T18:25:29Z")

</div>

You can also just throw a bunch of those images on a window randomly using the copy-paste method, and then using scripting to alter the properties of those components. You would have to get an instance of the root container (event.source.parent, or getWindow().getRootContainer(), for whatever scope you are using) for the window, and then iterate through all the components in a window using getComponents(). This will return an array of components that you can iterate through and change properties of.

---

<div class="post-metadata">

**Author:** ![njsd](https://avatars.discourse-cdn.com/v4/letter/n/54ee81/32.png) [@njsd](https://forum.inductiveautomation.com/u/njsd)\
**Post date:** [November 5, 2012, 3:31pm UTC](https://forum.inductiveautomation.com/t/creating-image-component-though-a-script/5367/5 "2012-11-05T15:31:43Z")

</div>

Is there a more in depth list of _all_ the scripting functions possible?

Thanks!

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 5, 2012, 3:47pm UTC](https://forum.inductiveautomation.com/t/creating-image-component-though-a-script/5367/6 "2012-11-05T15:47:50Z")

</div>

[quote=“njsd”]Is there a more in depth list of _all_ the scripting functions possible?

Thanks![/quote]

Our scripting functions are listed in the [user manual](http://www.inductiveautomation.com/support/usermanuals/ignition/) in Appendix C. Then, of course, there’s [all of Java](http://docs.oracle.com/javase/6/docs/api/) and [Python](http://docs.python.org/release/2.5/).

---

<div class="post-metadata">

**Author:** ![njsd](https://avatars.discourse-cdn.com/v4/letter/n/54ee81/32.png) [@njsd](https://forum.inductiveautomation.com/u/njsd)\
**Post date:** [November 5, 2012, 5:30pm UTC](https://forum.inductiveautomation.com/t/creating-image-component-though-a-script/5367/7 "2012-11-05T17:30:04Z")

</div>

Yes, your user manual has most of the methods, but for example:

> [@James.Lorenz](#):
>
> You can also just throw a bunch of those images on a window randomly using the copy-paste method, and then using scripting to alter the properties of those components. You would have to get an instance of the root container (event.source.parent, or getWindow().getRootContainer(), for whatever scope you are using) for the window, and then iterate through all the components in a window using getComponents(). This will return an array of components that you can iterate through and change properties of.

The getComponents() method is extremely useful and not listed anywhere that I can find.

Are there more hidden gems?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [November 5, 2012, 5:37pm UTC](https://forum.inductiveautomation.com/t/creating-image-component-though-a-script/5367/8 "2012-11-05T17:37:30Z")

</div>

Those are Java methods. There’s a million hidden gems, because you have access to Java and Python through scripting.

We don’t have a list compiled anywhere of any especially useful methods though. For most users diving into the Java or Python stuff is too complex.

---

<div class="post-metadata">

**Author:** ![njsd](https://avatars.discourse-cdn.com/v4/letter/n/54ee81/32.png) [@njsd](https://forum.inductiveautomation.com/u/njsd)\
**Post date:** [November 5, 2012, 5:40pm UTC](https://forum.inductiveautomation.com/t/creating-image-component-though-a-script/5367/9 "2012-11-05T17:40:48Z")

</div>

OK, thanks for your help!
