title: Draw string vertically with transparent background
body: <p>I would like to draw a string on the screen, rotated by 90 degrees, on a transparent background:</p>
  
  <pre><code>public static void drawStringWithTransformROT90(String text, int x, int y, int color, Graphics g) {
      // create a mutable image with white background color
      Image im = Image.createImage(g.getFont().stringWidth(text), g.getFont().getHeight());
      Graphics imGraphics = im.getGraphics();
      // set text color to black
      imGraphics.setColor(0x00000000);
      imGraphics.drawString(text, 0, 0, Graphics.TOP|Graphics.LEFT);
      int[] rgbData = new int[im.getWidth() * im.getHeight()];
      im.getRGB(rgbData, 0, im.getWidth(), 0, 0, im.getWidth(), im.getHeight());
      for (int i = 0; i &lt; rgbData.length; i++) {
          // if it is the background color (white), set it to transparent
          if (rgbData[i] == 0xffffffff) {
              rgbData[i] = 0x00000000;
          } else {
              // otherwise (black), change the text color
              rgbData[i] = color;
          }
      }
      Image imageWithAlpha = Image.createRGBImage(rgbData, im.getWidth(), im.getHeight(), true);
      Sprite s = new Sprite(imageWithAlpha);
      // rotate the text
      s.setTransform(Sprite.TRANS_ROT90);
      s.setPosition(x, y);
      s.paint(g);
  }
  </code></pre>
  
  <p>Is there any <em>better</em> way to do this? Should I create a transparent image with the alphabet rotated, and draw it using a <code>Sprite</code> object?</p>