Copyright by Jonathan S. Harbour

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

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 ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required