AffineTransform tx = AffineTransform.getTranslateInstance(dx1-transx,dy1-transy);
tx.scale(scalex,scaley);
BufferedImage mask = new BufferedImage(img.getWidth(observer), img.getHeight(observer), BufferedImage.TYPE_BYTE_BINARY);
Graphics g = mask.getGraphics();
g.fillRect(sx1,sy1, (int)swidth, (int)sheight);
drawImage(img, mask, tx, null, observer);
g.dispose();
return true;
}