title: java swt image (imagedata) rotation
body: <p>I'm trying to do a simple program, where I can add some png's to canvas.
  One of the option is to rotate selected png. I have problem with rotation.
  When I'm using Transformation it rotates everything on canvas.
  I founded only examples of rotation by 90' or flip but I want to rotate by any angle.</p>
  
  <p>I was also trying to convert swt image to bufferedimage, rotate then convert bufferedimage to swt image and draw it but it's very slow and having some problems with transparency.</p>
  
  <p>I'm will be gratefull for help - I want to rotate via center of image.
  For drawig I'm using GC and Canvas - new GC(canvas);</p>
  
  <hr>
  
  <p><strong>EDIT:</strong>
  I stil have problem with rotation by center of image:</p>
  
  <pre><code>gc.setAdvanced(true);
          if (!gc.getAdvanced()) {
              gc.drawText("Advanced graphics not supported", 30, 30, true);
              return;
          }
  
          Transform oldTransform = new Transform(gc.getDevice());  
          gc.getTransform(oldTransform);
  
          Transform transform = new Transform(GCController.getCanvas().getDisplay());
          transform.translate(width/2, height/2);
          transform.rotate(rotation);
          gc.setTransform(transform);
          gc.drawImage(image, x, y);
  
          gc.setTransform(oldTransform);
  
          transform.dispose();
  </code></pre>