Stretching a Bitmap

I have some bitmaps that I would like to double or triple in size. How can I do this in Java? I know in C++ there is a command to stretch a bitmap. I don’t know how to do this in Java.

If possible I would like to avoid Swing.

Check the graphics objects drawImage methods.



public loadImage(){
  mybitmap = new ImageIcon("mybitmat.jpg").getImage();
  //or use toolkit to load image if you don´t want ImageIcon
}

public void paint(Graphics g){
  g.drawImage(mybitmap, xpos, ypos,  scalewidth, scaleheigth, myframe);
}

This shows how to scale an image on the fly. That is not the best way to accomplise scaling. Try to look in to prescaling images before drawing them to screen