Hi, i'm writing an application that paint a TiledImage: this tiledimage is a background image where i want tu set different smaller images ( logos ) at different places.
here is the beginning of my method paint:
public void paint(TiledImage ti, Positioner pos){
Graphics g = ti.getGraphics();
Graphics2D g2 = (Graphics2D)g;
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
String dir = Options.getHomeDir() + File.separator + "images" + File.separator + "symbols" + File.separator;
boolean aa = g2.drawImage(Toolkit.getDefaultToolkit().getImage(dir + "hail64p.gif",70, 70, null);
this line doesn't work ( nothing is showed on that place )and aa is always false ( which mean it isn't still loaded )
I'm sure g2 is ok, because when I try this:
g2.setColor(Color.blue);
g2.drawString("testing drawstring",20,20);
it works... I don't understand the problem with drawImage. I've seen ( here: ) that JAI has problems with gif with transparent background, so i made my gif with a non-transparent background, but it doesn't resolve my problems: i'm also sure that the Toolkit works, because i've seen it detect that my gif size ( 64*64). Does anyone knows when this bug will be repaired ?
Thanks in advance for your help !
here is the beginning of my method paint:
public void paint(TiledImage ti, Positioner pos){
Graphics g = ti.getGraphics();
Graphics2D g2 = (Graphics2D)g;
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
String dir = Options.getHomeDir() + File.separator + "images" + File.separator + "symbols" + File.separator;
boolean aa = g2.drawImage(Toolkit.getDefaultToolkit().getImage(dir + "hail64p.gif",70, 70, null);
this line doesn't work ( nothing is showed on that place )and aa is always false ( which mean it isn't still loaded )
I'm sure g2 is ok, because when I try this:
g2.setColor(Color.blue);
g2.drawString("testing drawstring",20,20);
it works... I don't understand the problem with drawImage. I've seen ( here: ) that JAI has problems with gif with transparent background, so i made my gif with a non-transparent background, but it doesn't resolve my problems: i'm also sure that the Toolkit works, because i've seen it detect that my gif size ( 64*64). Does anyone knows when this bug will be repaired ?
Thanks in advance for your help !