overlay.java

来自「java 图形处理」· Java 代码 · 共 31 行

JAVA
31
字号
//package paint2d;

import java.awt.*;
import java.awt.geom.*;

/** A Overlay is a Picture that consists of
    one picture on top of another.
*/ 

public class Overlay extends Picture {

   private Picture over, under;

   /** Create Picture consisting of picture p1
       overlying picture p2.
   */
   public Overlay(Picture p1, Picture p2) {
      over = p1;
      under = p2;
   }

   /** Apply transformation t to this Overlay picture,
       and display it using graphics g2.
   */
   public void transDisplay
      (AffineTransform t, Graphics2D g2) {
      under.transDisplay(t,g2);
      over.transDisplay(t,g2);
   }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?