Hello,
This code is going to help you, take a look at it
Code:
public class buffimgConverter {
// default version of crbufimg
static public buffimg crbufimg(Image imageIn,
Component comp) {
return crbufimg(imageIn, buffimg.TYPE_INT_ARGB, comp);
}
static public buffimg crbufimg(Image imageIn,
int imageType, Component comp) {
MediaTracker med = new MediaTracker(comp);
med.addImage(imageIn, 0);
try {
med.waitForID(0);
} catch (InterruptedException ie) {
}
buffimg buffimgo = new buffimg(imageIn
.getWidth(null), imageIn.getHeight(null), imageType);
Graphics g = buffimgo.getGraphics();
g.drawImage(imageIn, 0, 0, null);
return buffimgo;
}
}
Bookmarks