Ok I am late to the game about using Image Sets. Using them allows me to not worry about the @1x, @2x, @3x versions and which one to use. Now I have many apps that have static images in a database (SQLite, PostgreSQL, etc) that I display in real time. Currently I have a PNG (I like PNGs over other formats) that is hex encoded to a string an put in a field in the database. When I go to display the image I create a new image from the decoded hex string as I display it.
Now how would I do it with Image Sets? They seem to be like some sort of container of the actual images but I am not sure. Can I treat them as a PNG image or do I have to do something special?
If you only have one size picture then you don’t really need to worry about it.
If you have multiple size pictures (of the same aspect ratio), you can combine them into an image by using the new Picture constructor. Then you use this new Picture (of type Image) and the appropriate size will be chosen based on what best matches the screen scaling.
Part of it depends on how you store it in the database. Store the X1,2,3 images in the database like you always do. Either add that to the name or add a scale factor field. Then use the Picture Constructor that Paul linked to above to pass the array of pictures.