public boolean drawImage(Image img,AffineTransform xform,ImageObserver observer){
  if (img == null) {
    return true;
  }
  if (xform == null || xform.isIdentity()) {
    return drawImage(img,0,0,null,observer);
  }
  if (isHiDPIImage(img)) {
    final int w=img.getWidth(null);
    final int h=img.getHeight(null);
    final AffineTransform tx=new AffineTransform(transform);
    transform(xform);
    boolean result=drawHiDPIImage(img,0,0,w,h,0,0,w,h,null,observer);
    transform.setTransform(tx);
    invalidateTransform();
    return result;
  }
  try {
    return imagepipe.transformImage(this,img,xform,observer);
  }
 catch (  InvalidPipeException e) {
    try {
      revalidateAll();
      return imagepipe.transformImage(this,img,xform,observer);
    }
 catch (    InvalidPipeException e2) {
      return false;
    }
  }
 finally {
    surfaceData.markDirty();
  }
}

public boolean drawImage ( Image img , AffineTransform xform , ImageObserver observer ) { if ( img == null ) { return true ; } if ( xform == null || xform . isIdentity ( ) ) { return drawImage ( img , 0 , 0 , null , observer ) ; } if ( isHiDPIImage ( img ) ) { final int w = img . getWidth ( null ) ; final int h = img . getHeight ( null ) ; final AffineTransform tx = new AffineTransform ( transform ) ; transform ( xform ) ; boolean result = drawHiDPIImage ( img , 0 , 0 , w , h , 0 , 0 , w , h , null , observer ) ; transform . setTransform ( tx ) ; invalidateTransform ( ) ; return result ; } try { return imagepipe . transformImage ( this , img , xform , observer ) ; } catch ( InvalidPipeException e ) { try { revalidateAll ( ) ; return imagepipe . transformImage ( this , img , xform , observer ) ; } catch ( InvalidPipeException e2 ) { return false ; } } finally { surfaceData . markDirty ( ) ; } }
draw an image , applying a transform from image space into user space before drawing . the transformation from user space into device space is done with the current transform in the graphics2d . the given transformation is applied to the image before the transform attribute in the graphics2d state is applied . the rendering attributes applied include the clip , transform , paint or color and composite attributes . note that the result is undefined , if the given transform is non - invertible .
