比如一副图像500*500  我只要画他的500*300  如何实现

解决方案 »

  1.   

    public abstract boolean drawImage(Image img,
                                      int x,
                                      int y,
                                      int width,
                                      int height,
                                      ImageObserver observer)
    img - 要绘制的指定图像。如果 img 为 null,则此方法不执行任何操作。
    x - x 坐标。
    y - y 坐标。
    width - 矩形的宽度。
    height - 矩形的高度。
    observer - 转换了更多图像时要通知的对象。
      

  2.   

    是指楼主的头像?
    OpenGL的Texture例子里经常看到