transform.translate(rect.width / 2, rect.height / 2);
transform.rotate(rotateSpinner.getSelection());
transform.translate(-rect.width / 2, -rect.height / 2);
if (invertButton.getSelection())
transform.invert();
gc.setTransform(transform);
gc.drawImage(image, 0, 0);
gc.drawRoundRectangle(0, 0, image.getBounds().width, image.getBounds().height, 22, 22);