I have a GUI built app, that manages profiles of clients. When a new profile is created, a picture is taken. The path (String) is saved in a Hashtable along with the other info.
When it displays the list of all clients, each client info is set in a Multibutton, each containing a small picture of the client. That picture is a masked picture that is set every time the form is loaded, making it very slow to load (when I didn't have the small pictures, it loaded faster).
Question
I would like to save the masked small picture right after I take & save the picture of the client. So when I display the list of clients, I would just fetch the small image instead of having to do the masking for all the items. Is this possible?
I am trying this: (my goal is to have a working "smallPhotoPath")
String bigPhotoPath = Capture.capturePhoto(width, -1);
Image bigPhoto = Image.createImage(bigPhotoPath);
...
//masking image
...
bigPhoto = bigPhoto.applyMask(mask);
String smallPhotoPath = bigPhotoPath+"Small";
Image smallPhoto = bigPhoto.scaled(bigPhoto.getWidth()/8, -1);
java.io.OutputStream os = Storage.getInstance().createOutputStream(smallPhotoPath);
ImageIO.getImageIO().save(smallPhoto, os, ImageIO.FORMAT_PNG, 1);
os.close();
