O'Reilly logo

Beginning Java SE 6 Game Programming, Third Edition by Jonathan S. Harbour

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Bitmap-Based Graphics

Java has a robust and feature-rich set of classes for working with 2D bitmap-based graphics (also known as raster graphics), allowing you to load and draw bitmaps very easily. Bitmaps are the keys to building a good 2D game with images rather than vector shapes.

Here are the key topics in this chapter:

  • Loading and drawing bitmap images

  • Applying transformations to bitmap images

  • Drawing opaque and transparent images

Programming Bitmapped Graphics

I mentioned before that there are many methods for drawing bitmap images in Java. Actually, most of those methods are found in the base Graphics class, while several more are found in Graphics2D. I think you will find the Graphics2D methods more useful, so we won’t spend any time ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required