09-23-2004, 02:41 PM
Join Date: Sep 2004
Post Thanks: 0
Thanked 0 Times in 0 Posts
| | Drawing text to an image
Please Login to Remove!
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"?