看过这个方法没有。
public abstract boolean drawImage(Image img,
                                   int dx1,
                                   int dy1,
                                   int dx2,
                                   int dy2,
                                   int sx1,
                                   int sy1,
                                   int sx2,
                                   int sy2,
                                   ImageObserver observer)Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the specified area of the destination drawable surface. Transparent pixels do not affect whatever pixels are already there. 
This method returns immediately in all cases, even if the image area to be drawn has not yet been scaled, dithered, and converted for the current output device. If the current output representation is not yet complete then drawImage returns false. As more of the image becomes available, the process that draws the image notifies the specified image observer. This method always uses the unscaled version of the image to render the scaled rectangle and performs the required scaling on the fly. It does not use a cached, scaled version of the image for this operation. Scaling of the image from source to destination is performed such that the first coordinate of the source rectangle is mapped to the first coordinate of the destination rectangle, and the second source coordinate is mapped to the second destination coordinate. The subimage is scaled and flipped as needed to preserve those mappings. 
Parameters: 
img - the specified image to be drawn 
dx1 - the x coordinate of the first corner of the destination rectangle. 
dy1 - the y coordinate of the first corner of the destination rectangle. 
dx2 - the x coordinate of the second corner of the destination rectangle. 
dy2 - the y coordinate of the second corner of the destination rectangle. 
sx1 - the x coordinate of the first corner of the source rectangle. 
sy1 - the y coordinate of the first corner of the source rectangle. 
sx2 - the x coordinate of the second corner of the source rectangle. 
sy2 - the y coordinate of the second corner of the source rectangle. 
observer - object to be notified as more of the image is scaled and converted. 

解决方案 »

  1.   

    多谢skyyoung(^c^)!是这样的:sx1sy1sx2sy2定位了图像的任意部分,dx1dy1dx2dy2定位了待显区域,故可将图像的任意部分随意放大缩小显示出来,俱爽!
      

  2.   

    Graphics的drawImage方法有很多重载,
    1.public abstract boolean drawImage( Image img, int x, int y, ImageObserver   observer ) 将Image对象img在 (x,y)坐标画出来( (x,y)为Image的左上角坐标,ImageObserver类型的observer作为图像装载的观察者,--Component类实现了ImageObserver接口,所以都可以作为图像观察者.
    2.public abstract boolean drawImage( Image img, int x, int y, int width, int height, ImageObserver observer ) 将Image对象img在 (x,y)坐标画出来, 画成 宽width,
    高为height,其余同上,可以实现图像的缩放.
    3.public abstract boolean drawImage( Image img, int x, int y, Color bgcolor, ImageObserver observer ) 同1,bgcolor为一个Color类的对象,设置图像背景色.
    4.public abstract boolean drawImage( Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer ) 同2,bgcolor为一个Color类的对象,设置图像背景色.
    5.public abstract boolean drawImage( Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer ) 这个方法比较复杂一点,
    Image img:同上.
    dx1,dy1:目标矩形的第一个角的坐标.
    dx2,dy2:目标矩形的第二个角的坐标.
    sx1,sy1:源矩形的第一个角的坐标.
    sx2,sy2:源矩形的第二个角的坐标.
    你可以指定源图像中的一块矩形区域(通过指定sx1,sy1;sx2,sy2)把它复制到目标矩形(通过指定dx1,dy1;dx2,dy2).其中(sx1,sy1)对映(dx1,dy1);(sx2,sy2)对映(dx2,dy2).可以实现图像的翻转,缩放等等功能.
    6.public abstract boolean drawImage( Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer ) 同5,bgcolor指定背景色.