public override bool drawImage(java.awt.Image img, int x, int y, java.awt.Color bgcolor, java.awt.image.ImageObserver observer) { Image image = J2C.ConvertImage(img); if (image == null) { return(false); } using (Brush brush = J2C.CreateBrush(bgcolor)) { g.FillRectangle(brush, x, y, image.Width, image.Height); } lock (image) { g.DrawImage(image, x, y); } return(true); }
public override bool drawImage(java.awt.Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, java.awt.Color color, java.awt.image.ImageObserver observer) { Image image = J2C.ConvertImage(img); if (image == null) { return(false); } Rectangle destRect = new Rectangle(dx1, dy1, dx2 - dx1, dy2 - dy1); Rectangle srcRect = new Rectangle(sx1, sy1, sx2 - sx1, sy2 - sy1); using (Brush brush = J2C.CreateBrush(color)) { g.FillRectangle(brush, destRect); } lock (image) { g.DrawImage(image, destRect, srcRect, GraphicsUnit.Pixel); } return(true); }