If that does not help, you're going to have to give a much better description of what you need before you can be helped.
Graphics2D g = myImage.createGraphics(); //in both of the following lines myOtherImage remains unchanged in content or size g.drawImage(myOtherImage, 0, 0, null); //does not change the size or either image g.drawImage)myOtherImage, 0, 0, myImage.getWidth()-1, myImage.getHeight()-1); //scales myOtherImage to fit the size of myImage
904150 wrote:Everything viewable in Java has a graphics context.
thanks. Now if I don't want change the Image, just display on JPanel's new rectangle(not equals to the size of image).Could I get a new Graphics2D object from this context? I can use it draw Line on Image, it should be a scaled pen line-width.