Using Paintable Canvas to get Blob image from MySQL

I am trying to get an image from a BLOB column in ignition. I have an image stored in MySQL in a blob column currently and am trying to display it with the paintable canvas in Ignition Vision 8.1. The code I am using currently is not working. Any help would be appreciated!

What does happen? Any errors in the console? Your approach there is still relatively inefficient, by the way - ImageIO's construction of the image isn't free and is going to be called often. It'd be better to cache the actual Image instance.

There aren't any errors in the console. When I put the designer into preview mode nothing shows up for the paintable canvas, and no errors are put into the console.

This may help simplify your efforts
Automation Professionals' Blob Server Module - 3rd Party Modules - Inductive Automation Forum

1 Like

Not necessary for Vision. Vision can call a named query natively.

1 Like

Pssst! Don't run a query inside a repaint event! Run the query as a named query binding on a custom property. Then the repaint event can just read the bytes. (And draw nothing when no bytes are present.)

1 Like

For anyone that comes into this to check for solution. I ended up getting it to work by defining column and row index from sql query return. Also used @pturmel suggestion and placed the query inside a custom property.