Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What do x,y in java.awt.Graphics.drawImage() refer to?

refer y
0
Posted

What do x,y in java.awt.Graphics.drawImage() refer to?

0

The x,y in drawImage refer to the location on the screen (relative to the origin or translation of the Graphics object) at which to draw the upper left corner of the image. The reason this is confusing in the “drawing a subset of an image” example you have is that if you want pixel i,j of the image to appear at 0,0 which is also the upper left corner of the clipping rectangle, then you have to draw the image at screen location -i,-j so that the screen location 0,0 is i pixels from the left edge of the image and j pixels from the top edge of the image – thus screen location 0,0 shows image pixel i,j…

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123