# Handler after image loaded

**URL:** https://forums.fusetools.com/t/handler-after-image-loaded/2639
**Category:** How-to Discussions
**Created:** [June 26, 2015, 8:37am UTC](https://forums.fusetools.com/t/handler-after-image-loaded/2639 "2015-06-26T08:37:29Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Mao](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@Mao](https://forums.fusetools.com/u/Mao)
#### Post date: [June 26, 2015, 8:37am UTC](https://forums.fusetools.com/t/handler-after-image-loaded/2639/1 "2015-06-26T08:37:29Z")

</div>

How to add a handler to an image and run it after image loaded? Thanks!

---

<div class="post-metadata">

### Author: ![edA-qa\_mort-ora-y](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/eda-qa_mort-ora-y/32/124_2.png) [@edA-qa\_mort-ora-y](https://forums.fusetools.com/u/edA-qa_mort-ora-y)
#### Post date: [June 26, 2015, 10:21am UTC](https://forums.fusetools.com/t/handler-after-image-loaded/2639/2 "2015-06-26T10:21:28Z")

</div>

From Uno code you can subscribe to the `ImageSource.Changed` event to be informed of changes in its `State`.

---

<div class="post-metadata">

### Author: ![Mao](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@Mao](https://forums.fusetools.com/u/Mao)
#### Post date: [June 30, 2015, 9:59am UTC](https://forums.fusetools.com/t/handler-after-image-loaded/2639/3 "2015-06-30T09:59:18Z")

</div>

Thank you for reply.

I tried to subscribe to the event and it can really inform me about the State changes. However, when I tried to get the image height and width after state changes (pending -\> ready), it still give me 0,0 immediately. Then I try to solve it with a timer, it worked but sometimes failed if too many images are loaded at same time or other reasons idk.

It shows the problem that:

1. Although state is changed, the image are not fully loaded at the same time actually.
2. Despite I added the timer, I still can’t get the correct size sometimes.

You might concern that why don’t I just preload the images as what you told me in the other post. This is because I found difficulty to preload a bundle of images and it seems not work despite preloaded.

Thank you for help a lot!
