Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. public void removeVPath(int[] path) {
  2. // show yellow flashes along the path
  3. for (int y = 0; y < sizeY(); y++) {
  4. component.bim.setRGB(path[y], y, 0xffffff00);
  5. }
  6. frame.repaint();
  7. // delete path from image
  8. BufferedImage newimage = new BufferedImage(sizeX() - 1, sizeY(), TYPE_INT_ARGB);
  9. for (int y = 0; y < sizeY(); y++) {
  10. for (int x = 0; x < sizeX() - 1; x++) {
  11. int xo = x + ((x >= path[y]) ? 1 : 0);
  12. newimage.setRGB(x, y, component.bim.getRGB(xo, y));
  13. }
  14. }
  15. component.bim = newimage;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement