I have some TIFF files that contain multiple sizes of an image (icons)
Up to this point I only needed one size (ie. 2 images for @1x and @2x)
but now I find I need another set but smaller
So right now I have an imageset with [email@example.com and firstname.lastname@example.org] which are used as 48x48 images
and need [email@example.com and firstname.lastname@example.org]
Is there any way to use the original TIFF file and have the app know which image to use?
or do I need to extract the images (which is easy enough) and then construct TWO ImageSets…
Its not a big deal… I just wanted to reduce the physical files that would exist in the resouces directory
in the same vein as the above… if I DO have to create two image sets…
Does Xojo optimize the # of physical files used?
Image Set #1 is for 32x32 … so it has [x32x32.png and x64x64.png]
Image Set #2 is for 16x16 … so it would have [x16x16.png and x32x32.png]
Does Xojo make 3 or 4 files? … that is would x32x32.png appear inside the bundle twice?
Actually it would have x32x32.png and email@example.com which are 32x32 pixels and 64x64 pixels
And no Xojo wont reduce the number of files
It really cant wIthout doing a bunch of image processing to know for certain that there are duplicates
and actually… it seems that Xojo really doesn’t care what the physical files names are
I just created an Imageset that contained
- ABC.PNG (48x48)
- XYZ.PNG (96x96)
and renamed the Imageset itself TEST
and it worked just fine
so the only name that matters is the imageset name, not the filenames associated with the individual images…
now that being said… using a proper @1x @2x naming convention makes it easier for the developer, but the app won’t care.
EDIT… When compiling… Xojo DOES rename the files that appear in the compiled bundle
I created a 32x32, 64x64 and 128x128 image
made two imagesets
- a32.png and a64.png
- a64.png and a128.png
Xojo changed this to
- a32.png and firstname.lastname@example.org
- a64.png and email@example.com
You can use TiffPictureMBS class to read a multi picture TIFF at runtime and than build a Xojo picture image set in memory.
How is that a benefit?
I would have to have 128 discrete images in the IDE project instead of 64 ImageSets
besides… I have no desire nor budget to purchase MBS
I already have my own software to disassemble the TIFF to create the required imagesets
You could put 100 pictures in one TIFF file if you like.
that doesn’t help assigning the correct “size” to a canvas, or any other image oriented control
from what I can see, an ImageSet does all the “retina” magic for you, or so far that is what I am seeing happen
but if the TIFF contains 16x16, 32x32 and 64x64 , then I have to decide and code for the correct image to extract when necessary.
as those would equate to x16@1x, x16@2x, x32@1x and x32@2x…
Yes, the framework figures out the best image to use, based on the Graphics.ScaleX and ScaleY properties and the size of the thing you are drawing.
for an IMAGESET… that I see… my question was in relation to Christians comment about 100 images in a TIFF