Guest User

Untitled

a guest
Jan 4th, 2013
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. List<Bitmap> avatars = new List<Bitmap>();
  2.  
  3. private void GameForm_Load(object sender, EventArgs e)
  4. {
  5. avatars.Add(Properties.Resources.Head1);
  6. avatars.Add(Properties.Resources.Head2);
  7. avatars.Add(Properties.Resources.Head3);
  8. avatars.Add(Properties.Resources.Head4);
  9. }
  10.  
  11. private void pictureBoxAvatar1_Click(object sender, EventArgs e)
  12. {
  13.  
  14. if(pictureBoxAvatar1.Image == avatars.ElementAt(0))
  15. {
  16. pictureBoxAvatar1.Image = avatars.ElementAt(1);
  17. }
  18. //I have four total possibilities, but just have this one statement until I figure it out
  19.  
  20. }
  21.  
  22. private void pictureBoxAvatar1_Click(object sender, EventArgs e)
  23. {
  24. pictureBoxAvatar1.ImagePointer = (pictureBoxAvatar1.ImagePointer + 1) % avatars.size();
  25. }
  26.  
  27. int avIndex = avatars.IndexOf(picturebox1.image);
  28. avIndex++;
  29. if (avIndex >= avatars.Count)
  30. {
  31. avIndex = 0;
  32. }
  33. picturebox1.image = avatars[avIndex];
Add Comment
Please, Sign In to add comment