# Paintable Canvas not refreshing Image

**URL:** <https://forum.inductiveautomation.com/t/paintable-canvas-not-refreshing-image/35129>\
**Category:** Ignition\
**Created:** [May 28, 2020, 4:07pm UTC](https://forum.inductiveautomation.com/t/paintable-canvas-not-refreshing-image/35129 "2020-05-28T16:07:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jholloway](https://avatars.discourse-cdn.com/v4/letter/j/3ab097/32.png) [@jholloway](https://forum.inductiveautomation.com/u/jholloway)\
**Post date:** [May 28, 2020, 4:07pm UTC](https://forum.inductiveautomation.com/t/paintable-canvas-not-refreshing-image/35129/1 "2020-05-28T16:07:38Z")

</div>

I am having issues with the display of a paintable canvas object. I am bringing in a BLOB image from a database. I am running into issues with the image refreshing.

My code is all stored in the repaint event handler. I believe that the data is coming in for the updated image but the object itself is not refreshing. If I resize the window it shows the correct image or if I hover over the paintable object and a dialog box appears when I move the mouse away the correct pixels are shown only where the box was.

---

<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:** [May 28, 2020, 4:21pm UTC](https://forum.inductiveautomation.com/t/paintable-canvas-not-refreshing-image/35129/2 "2020-05-28T16:21:00Z")

</div>

Refresh of the paintable canvas is triggered by any event that triggers a propertyChange. You should not do any calls to your gateway in the paint event (you risk a locked UI). Use binding to bring the blob data to a custom dataset property on the paintable canvas, and have the paint event get its image data from that property. That hits two birds with one stone: avoid UI lockups, and provides a propertyChange that will trigger refresh.

---

<div class="post-metadata">

**Author:** ![jholloway](https://avatars.discourse-cdn.com/v4/letter/j/3ab097/32.png) [@jholloway](https://forum.inductiveautomation.com/u/jholloway)\
**Post date:** [May 29, 2020, 2:58pm UTC](https://forum.inductiveautomation.com/t/paintable-canvas-not-refreshing-image/35129/3 "2020-05-29T14:58:50Z")

</div>

Thanks for the help! I found an older post where you described the same thing. That worked!
