equal
deleted
inserted
replaced
323 } |
323 } |
324 } |
324 } |
325 |
325 |
326 public static Image createRGBImage(int[] aRgb, int aWidth, int aHeight, boolean aProcessAlpha) |
326 public static Image createRGBImage(int[] aRgb, int aWidth, int aHeight, boolean aProcessAlpha) |
327 { |
327 { |
328 if (aRgb.length < (aWidth * aHeight)) |
328 if (aWidth <= 0 || aHeight <= 0) |
|
329 { |
|
330 throw new IllegalArgumentException(); |
|
331 } |
|
332 |
|
333 if (aRgb.length < (aWidth * aHeight) || (aWidth * aHeight) < 0) |
329 { |
334 { |
330 throw new ArrayIndexOutOfBoundsException(); |
335 throw new ArrayIndexOutOfBoundsException(); |
331 } |
336 } |
332 |
|
333 if (aWidth <= 0 || aHeight <= 0) |
|
334 { |
|
335 throw new IllegalArgumentException(); |
|
336 } |
|
337 |
|
338 try |
337 try |
339 { |
338 { |
340 return new Image(aRgb, aWidth, aHeight, aProcessAlpha); |
339 return new Image(aRgb, aWidth, aHeight, aProcessAlpha); |
341 } |
340 } |
342 catch (OutOfMemoryError oom) |
341 catch (OutOfMemoryError oom) |