Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. for (int x = 0; x < width; x += 1)
  2. {
  3. for (int y = 0; y < height; y += 1)
  4. {
  5. fontColor = tempImage.GetPixel(x, y);
  6. index = rand.Next(image.Length);
  7.  
  8. //Check if the color empty
  9. if (fontColor.Name == Color.Empty.Name)
  10. {
  11. for (int i = 0; i < image.Length; i++)
  12. {
  13. if (index == 0)
  14. {
  15. image[i].SetPixel(x * 2, y, Color.Black);
  16. image[i].SetPixel(x * 2 + 1, y, Color.Empty);
  17. }
  18. else
  19. {
  20. image[i].SetPixel(x * 2, y, Color.Empty);
  21. image[i].SetPixel(x * 2 + 1, y, Color.Black);
  22. }
  23. }
  24. }
  25. else
  26. {
  27. for (int i = 0; i < image.Length; i++)
  28. {
  29. if ((index + i) % image.Length == 0)
  30. {
  31. image[i].SetPixel(x * 2, y, Color.Black);
  32. image[i].SetPixel(x * 2 + 1, y, Color.Empty);
  33. }
  34. else
  35. {
  36. image[i].SetPixel(x * 2, y, Color.Empty);
  37. image[i].SetPixel(x * 2 + 1, y, Color.Black);
  38. }
  39. }
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement