Search code examples
javapixel

Space Between Pixels


I'm relatively new to programming and have a question about drawing to the display. I'm sure this is not specific to Java, but I am learning Java so I will ask it in that context. Here is some context for the question:

From the Wikipedia entry for "Pixel" (emphasis added): "In digital imaging, a pixel ... is the smallest controllable element of a picture represented on the screen."

From the Java API entry for Class "Graphics" (emphasis added): "Operations that draw the outline of a figure operate by traversing an infinitely thin path between pixels with a pixel-sized pen that hangs down and to the right of the anchor point on the path."

My question is:

How is Java able to represent outlines of figures as the space between pixels when a pixel is the smallest controllable element of a display?

Put another way:

0|0

The "0"s above are two pixels. The "|" above is the "infinitely thin path between pixels." If only the "0"s can change, how does Java make the "|" visible to humans? Does it change the color of the edges of the "0"s? (Is that what "pixel-sized pen" means - it colors half of both pixels?)


Solution

  • that hangs down and to the right of the anchor point on the path

    The pen will draw the right 0.