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

Method scale

CodenameOne/src/com/codename1/ui/RGBImage.java:114–130  ·  view source on GitHub ↗
(int width, int height)

Source from the content-addressed store, hash-verified

112
113 /// {@inheritDoc}
114 @Override
115 public void scale(int width, int height) {
116 int srcWidth = getWidth();
117 int srcHeight = getHeight();
118
119 // no need to scale
120 if (srcWidth == width && srcHeight == height) {
121 return;
122 }
123 int[] currentArray = new int[srcWidth];
124 int[] destinationArray = new int[width * height];
125 scaleArray(srcWidth, srcHeight, height, width, currentArray, destinationArray);
126
127 this.width = width;
128 this.height = height;
129 this.rgb = destinationArray;
130 }
131
132 /// Unsupported in the current version, this method will be implemented in a future release
133 @Override

Callers 1

Calls 3

getWidthMethod · 0.95
getHeightMethod · 0.95
scaleArrayMethod · 0.45

Tested by 1