# Change position a JPG or PNG image

**URL:** <https://forum.inductiveautomation.com/t/change-position-a-jpg-or-png-image/54890>\
**Category:** Ignition\
**Created:** [January 11, 2022, 5:12pm UTC](https://forum.inductiveautomation.com/t/change-position-a-jpg-or-png-image/54890 "2022-01-11T17:12:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![xavo1992](https://avatars.discourse-cdn.com/v4/letter/x/779978/32.png) [@xavo1992](https://forum.inductiveautomation.com/u/xavo1992)\
**Post date:** [January 11, 2022, 5:12pm UTC](https://forum.inductiveautomation.com/t/change-position-a-jpg-or-png-image/54890/1 "2022-01-11T17:12:00Z")

</div>

Hi, I need yours help.

I’m traying in runtime to change the position to a imagen file which is constantly changing, with a variable’s value. The problem is, I can´t find in the property editor the fiel “Position” to configure it directly.

With a SVG, Yes I can, but I can´t with a PNG.

Please, Help me. Maybe with a scrib code or another method.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 11, 2022, 5:14pm UTC](https://forum.inductiveautomation.com/t/change-position-a-jpg-or-png-image/54890/2 "2022-01-11T17:14:58Z")

</div>

In Vision, or Perspective?

---

<div class="post-metadata">

**Author:** ![xavo1992](https://avatars.discourse-cdn.com/v4/letter/x/779978/32.png) [@xavo1992](https://forum.inductiveautomation.com/u/xavo1992)\
**Post date:** [January 11, 2022, 5:38pm UTC](https://forum.inductiveautomation.com/t/change-position-a-jpg-or-png-image/54890/3 "2022-01-11T17:38:50Z")

</div>

Vision

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 11, 2022, 5:43pm UTC](https://forum.inductiveautomation.com/t/change-position-a-jpg-or-png-image/54890/4 "2022-01-11T17:43:38Z")

</div>

You don’t bind a variable directly. You use `system.gui.transform()` to move the component. Typically you’d bind the tag that supplies position to a custom property, then use a propertyChange event script to issue the transform() call when that custom property changes.

---

<div class="post-metadata">

**Author:** ![xavo1992](https://avatars.discourse-cdn.com/v4/letter/x/779978/32.png) [@xavo1992](https://forum.inductiveautomation.com/u/xavo1992)\
**Post date:** [January 11, 2022, 5:49pm UTC](https://forum.inductiveautomation.com/t/change-position-a-jpg-or-png-image/54890/5 "2022-01-11T17:49:10Z")

</div>

I Do it like this

```auto
newx = system.tag.read('Prueba/Prueba_1/Variables/MW262').value

window = system.gui.getWindow("Paso")
text_1 = window.rootContainer.getComponent("Image")

system.gui.transform( text_1, newx)

```

But Now, I Have another problem. My Window Paso is my auxiliary monitor with Index 1. So my code doesn´t work in a timer scrip. I tried it in the Script Console with de windows edit open.

How can i select de window whent this code is running?

---

<div class="post-metadata">

**Author:** ![xavo1992](https://avatars.discourse-cdn.com/v4/letter/x/779978/32.png) [@xavo1992](https://forum.inductiveautomation.com/u/xavo1992)\
**Post date:** [January 11, 2022, 5:50pm UTC](https://forum.inductiveautomation.com/t/change-position-a-jpg-or-png-image/54890/6 "2022-01-11T17:50:57Z")

</div>

I’m working on ignition 7.9

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 11, 2022, 6:04pm UTC](https://forum.inductiveautomation.com/t/change-position-a-jpg-or-png-image/54890/7 "2022-01-11T18:04:14Z")

</div>

Don’t use a tag event script. Don’t try to use .getWindow(). Just add a custom property to your image component. Call it “newX”, perhaps. Then, in _ **that component** _, create a property change event that looks like this:

```auto
if event.propertyName=='newX':
	system.gui.transform(event.source, event.newValue)

```

On the `newX` property, use a **tag binding** to `Prueba/Prueba_1/Variables/MW262`.

---

<div class="post-metadata">

**Author:** ![xavo1992](https://avatars.discourse-cdn.com/v4/letter/x/779978/32.png) [@xavo1992](https://forum.inductiveautomation.com/u/xavo1992)\
**Post date:** [January 14, 2022, 8:09pm UTC](https://forum.inductiveautomation.com/t/change-position-a-jpg-or-png-image/54890/8 "2022-01-14T20:09:15Z")

</div>

It’s working! I am very grateful for your help
