View Single Post
Old 09-23-2004, 01:41 PM   #1 (permalink)
New Member
Join Date: Sep 2004
Posts: 4
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Drawing text to an image

Please Login to Remove!

Hi All,

There appears to be a bug with creating an image of ODD width and drawing text to that image. For example,

protected void paint(Graphics g)
Image img = Image.createImage(101, 100);
Graphics gi = img.getGraphics();
gi.drawString("test", 0, 0, Graphics.TOP | Graphics.LEFT);
g.drawImage(img, 0, 0, Graphics.TOP | Graphics.LEFT);

The text in the image appears "skewed". However, if the image is created with an EVEN width(Image.createImage(100,100)) everything is fine. This only happens on color devices(7200 and 7700). Does anyone know a fix for "bug"?