[Gambas-user] Save imageview.image back to database

Tobias Boege tobs at taboege.de
Mon Sep 27 12:05:14 CEST 2021


On Mon, 27 Sep 2021, bb wrote:
> I have searched and searched for this to no avail.
> 
> I have an imageview with an image. I want to save it to the database as
> a BLOB.
> 
> I know well how to do it the other way around, take the database blob
> and save it to a temporary file, then load the ImageView.Image from
> that file.
> 
> I just can't remember or find how to do the save way.
> 

Under app/examples/Database there is the old PictureDatabase example which
taught me how to do it. You take your Image, save it to a temporary file
and then get the bytes from File.Load() into the Blob.

I don't think there are methods on Image or Picture that allow to do it
in-memory (but there should be).

Best,
Tobias

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk


More information about the User mailing list