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

Method subImage

CodenameOne/src/com/codename1/ui/Image.java:1270–1280  ·  view source on GitHub ↗
(int x, int y, int width, int height, boolean processAlpha)

Source from the content-addressed store, hash-verified

1268 ///
1269 /// An array of all the possible images that can be created from the source
1270 public Image subImage(int x, int y, int width, int height, boolean processAlpha) {
1271 // we use the getRGB API rather than the mutable image API to allow translucency to
1272 // be maintained in the newly created image
1273 int[] arr = new int[width * height];
1274 getRGB(arr, 0, x, y, width, height);
1275
1276 Image i = new Image(Display.impl.createImage(arr, width, height));
1277 i.opaque = opaque;
1278 i.opaqueTested = opaqueTested;
1279 return i;
1280 }
1281
1282 /// Creates a mirror image for the given image which is useful for some RTL scenarios. Notice that this
1283 /// method isn't the most efficient way to perform this task and is designed for portability over efficiency.

Callers 10

fillMethod · 0.95
heroMethod · 0.95
testSubImageMethod · 0.95
getFrameMethod · 0.45
getImageMethod · 0.45
invoke8Method · 0.45
cropFrameMethod · 0.45
getRowMethod · 0.45
getRowMethod · 0.45

Calls 2

getRGBMethod · 0.95
createImageMethod · 0.45

Tested by 3

heroMethod · 0.76
testSubImageMethod · 0.76
cropFrameMethod · 0.36