MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / tileImage

Method tileImage

CodenameOne/src/com/codename1/ui/Graphics.java:1968–2000  ·  view source on GitHub ↗
(Image img, int x, int y, int w, int h)

Source from the content-addressed store, hash-verified

1966 ///
1967 /// - `h`: coordinate to tile the image along
1968 public void tileImage(Image img, int x, int y, int w, int h) {
1969 if (img.requiresDrawImage()) {
1970 int iW = img.getWidth();
1971 int iH = img.getHeight();
1972 int clipX = getClipX();
1973 int clipW = getClipWidth();
1974 int clipY = getClipY();
1975 int clipH = getClipHeight();
1976 clipRect(x, y, w, h);
1977 for (int xPos = 0; xPos <= w; xPos += iW) {
1978 for (int yPos = 0; yPos < h; yPos += iH) {
1979 int actualX = xPos + x;
1980 int actualY = yPos + y;
1981 if (actualX > clipX + clipW) {
1982 continue;
1983 }
1984 if (actualX + iW < clipX) {
1985 continue;
1986 }
1987 if (actualY > clipY + clipH) {
1988 continue;
1989 }
1990 if (actualY + iH < clipY) {
1991 continue;
1992 }
1993 drawImage(img, actualX, actualY);
1994 }
1995 }
1996 setClip(clipX, clipY, clipW, clipH);
1997 } else {
1998 impl.tileImage(nativeGraphics, img.getImage(), x + xTranslate, y + yTranslate, w, h);
1999 }
2000 }
2001
2002 /// Returns the affine X scale
2003 ///

Callers 8

paintMethod · 0.45
paintMethod · 0.45
paintMethod · 0.45
paintBorderBackgroundMethod · 0.45
drawImageBorderLineMethod · 0.45
drawImageBorderColumnMethod · 0.45
paintMethod · 0.45
drawContentMethod · 0.45

Calls 11

getClipXMethod · 0.95
getClipWidthMethod · 0.95
getClipYMethod · 0.95
getClipHeightMethod · 0.95
clipRectMethod · 0.95
drawImageMethod · 0.95
setClipMethod · 0.95
getWidthMethod · 0.65
getHeightMethod · 0.65
getImageMethod · 0.65
requiresDrawImageMethod · 0.45

Tested by 1

drawContentMethod · 0.36