Save ImageSet to File?

I know it’s possible to save a Picture to a file as a .PNG or other format. Is there a way to do this for an ImageSet Picture as well?

Is there a way that I can build an Imageset Picture with “Picture.Constructor(width as Integer, height as Integer, bitmaps() As Picture)” and then save the resulting Picture as an imageName.xojo_image file; such that another Xojo program will read and use that file as a valid Xojo ImageSet picture when read?

I’m sort-of guessing at what you’re asking, but I suspect the answer is no. The .imageset is a code representation that defines the @1, @2, and @3 sizes of a given image.

You could however use GetData to convert to a string, convert that to hex or base64 and then save as… let’s say JSON so you could store name, dimensions, dpi, etc. then it would be relatively easy to reconstitute in the other end.

Technically you could use a file format such as TIFF, which allows for multiple images to be to stored within the same file. However I don’t know if Xojo supports multi-image tiffs.

It’s more than possible to use a Xojo application to create a multi-frame TIFF file (via Declares on the MacOS), but I wouldn’t recommend it as there is a performance penalty when reading the file back in, converting the frames into Xojo pictures and then reassembling the multi-representation picture, that I haven’t been able to find a way around (yet).