What's wrong with this?
<CODE>
public void drawBlendImage(Graphics g, Image img1, Image img2, float opacity)
{
BufferedImage buf=new BufferedImage(320,200, BufferedImage.TYPE_4BYTE_ABGR);
Graphics bufg=buf.createGraphics();
bufg.drawImage(image1, 0, 0, null);
Raster alpha=buf.getAlphaRaster();
for (int i=0;i<320;i++)
for (int j=0;j<200;j++)
{
alpha.setSample(i,j,0, opacity);
}
g.drawImage(img2,0,0, null);
g.drawImage(buf, 0, 0, null);
}
</CODE>
What's wrong with this?
[<CODE>]
public void drawBlendImage(Graphics g, Image img1, Image img2, float opacity)
{
BufferedImage buf=new BufferedImage(320,200, BufferedImage.TYPE_4BYTE_ABGR);
Graphics bufg=buf.createGraphics();
bufg.drawImage(image1, 0, 0, null);
Raster alpha=buf.getAlphaRaster();
for (int i=0;i<320;i++)
for (int j=0;j<200;j++)
{
alpha.setSample(i,j,0, opacity);
}
g.drawImage(img2,0,0, null);
g.drawImage(buf, 0, 0, null);
}
[</CODE>]