alla fine c sono riuscito... dunque, ho creato 1 nuova classe che estende un JPanele ho sovrascritto il metodo paint(Graphics g).
questo è il codice:
codice:
Graphics2D g2 = (Graphics2D)g;
if(backImage.getWidth() > -1 && backImage.getHeight() > -1 &&
jerseyImage.getWidth() > -1 && jerseyImage.getHeight() > -1 &&
backImage.getRGB(0, 0) != 0 && jerseyImage.getRGB(0, 0) != 0)
{
for(int i = 0; i < backImage.getWidth(); i++)
{
for(int j = 0; j < backImage.getHeight(); j++)
{
Color c1 = new Color(backImage.getRGB(i, j));
Color c2 = new Color(jerseyImage.getRGB(i, j));
Color c = new Color((c1.getRed() + c2.getRed()) / 2,
(c1.getGreen() + c2.getGreen()) / 2,
(c1.getBlue() + c2.getBlue()) / 2);
ig2.setColor(c);
ig2.drawRect(i, j, 1, 1);
}
}
}
// Disegna l'immagine sul pannello
g2.drawImage(risImg, null, 0, 0);
ho tralasciato alcune parti del metodo, cmq backImage (la prima immagine), jerseyImage(la seconda immagine) e risImage(il risultato) sono BufferedImage di dimensioni 128 x 128 e di tipo TYPE_4BYTE_ABGR.
il tutto restituisce il risultato desiderato, solo ke c mette almeno 1 o 2 secondi a visualizzare l'immagine... nn ci può fare qualcosa x velocizzare il tutto??? grazie