![]() |
The Java Developers Almanac 1.4Order this book from Amazon. |
e576. Drawing with Alpha// See e575 The Quintessential Drawing Program public void paint(Graphics g) { Graphics2D g2d = (Graphics2D)g; // Draw background... // Set alpha. 0.0f is 100% transparent and 1.0f is 100% opaque. float alpha = .3f; g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha)); // Draw foreground... }
e577. Enabling Antialiasing e578. Setting the Clipping Area with a Shape e579. Changing the Thickness of the Stroking Pen e580. Stroking or Filling with a Texture e581. Animating an Array of Images in an Application
© 2002 Addison-Wesley. |