# View Images from Database

**URL:** <https://forum.inductiveautomation.com/t/view-images-from-database/22626>\
**Category:** Ignition Early Access\
**Created:** [February 15, 2019, 9:52pm UTC](https://forum.inductiveautomation.com/t/view-images-from-database/22626 "2019-02-15T21:52:39Z")\
**Posts on this page:** 1\
**Showing post:** 17

<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:** [September 24, 2020, 12:35am UTC](https://forum.inductiveautomation.com/t/view-images-from-database/22626/17 "2020-09-24T00:35:30Z")

</div>

The Paintable Canvas component is the most flexible tool to display arbitrarily-encoded images. Start here:

> [@Database and Paintable Canvas Refresh](http://forum.inductiveautomation.com/t/database-and-paintable-canvas-refresh/21865/2):
>
> Where is this code? In the paint method? If so, break it up so your db query runs separately (on some propertyChange) to obtain and set the client property. Say, on your Documents table, have a propertyChange that does most of the work, but only on image change, like so: if event.propertyName == 'id': from javax.imageio import ImageIO from java.io import ByteArrayInputStream blob = system.db.runPrepQuery(“SELECT file FROM magna\_silao.documents where id= ?”, [event.newValue]) bytes = blo…

Other related topics:

[http://forum.inductiveautomation.com/search?q=paintable%20canvas%20imageio](http://forum.inductiveautomation.com/search?q=paintable%20canvas%20imageio)

---

_[View the full topic](https://forum.inductiveautomation.com/t/view-images-from-database/22626)._
