B
This commit is contained in:
parent
e5e8880e41
commit
518da4a923
1019 changed files with 15877 additions and 0 deletions
19
Task/Bitmap/Java/bitmap-2.java
Normal file
19
Task/Bitmap/Java/bitmap-2.java
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import java.awt.Color;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
public class BasicBitmapStorageTest extends TestCase
|
||||
{
|
||||
public static final int WIDTH = 640, HEIGHT = 480;
|
||||
|
||||
BasicBitmapStorage bbs = new BasicBitmapStorage(WIDTH, HEIGHT);
|
||||
|
||||
public void testHappy()
|
||||
{
|
||||
bbs.fill(Color.cyan);
|
||||
bbs.setPixel(WIDTH / 2, HEIGHT / 2, Color.BLACK);
|
||||
Color c1 = bbs.getPixel(WIDTH / 2, HEIGHT / 2);
|
||||
Color c2 = bbs.getPixel(20, 20);
|
||||
assertEquals(Color.BLACK, c1);
|
||||
assertEquals(Color.CYAN, c2);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue