Advertisement
Guest User

Untitled

a guest
Aug 12th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. if (choice.equals("Japanische Fahne")) {
  2. // Schleife ueber die y-Werte
  3.  
  4. // Schleife ueber die y-Werte
  5.  
  6. for (int y = 0; y < height; y++) {
  7.  
  8. // Schleife ueber die x-Werte
  9.  
  10. for (int x = 0; x < width; x++) {
  11.  
  12. int pos = y * width + x; // Arrayposition bestimmen
  13.  
  14. int r = 255;
  15.  
  16. int g = 255;
  17.  
  18. int b = 255;
  19.  
  20. // Werte zurueckschreiben
  21.  
  22. pixels[pos] = 0xFF000000 | (r << 16) | (g << 8) | b;
  23.  
  24. }
  25. int Mx = (width / 2); // 258
  26. int My = (height / 2); // 200
  27.  
  28. int radius = 50;
  29.  
  30. int PX = 260;
  31. int PY = 210;
  32. int RX = (width / 2) + (radius);
  33. int RY = (height / 2);
  34.  
  35. int d = (sqrt ((PY - RX) ^ 2 + (PX - RY) ^ 2));
  36.  
  37. for (int x = 0; x < width; x++) {
  38. if (d <= radius) {
  39. int pos = y * width + x; // Arrayposition bestimmen
  40.  
  41. int r = 255;
  42.  
  43. int g = 0;
  44.  
  45. int b = 0;
  46. }
  47.  
  48. }
  49.  
  50. }
  51.  
  52. // //////////////////////////////////////////////////////////////////
  53.  
  54. // neues Bild anzeigen
  55.  
  56. imagePlus.show();
  57.  
  58. imagePlus.updateAndDraw();
  59.  
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement