Created
July 18, 2014 05:38
-
-
Save yashihei/a6819b32e01b84128cfd to your computer and use it in GitHub Desktop.
てくなんず
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Data; | |
using System.Drawing; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Windows.Forms; | |
namespace WindowsFormsApplication2 | |
{ | |
public partial class Form1 : Form | |
{ | |
Image img = Image.FromFile("imgres.jpg"); | |
List<Point> points = new List<Point>(); | |
public Form1() | |
{ | |
InitializeComponent(); | |
} | |
private void button1_Click(object sender, EventArgs e) | |
{ | |
Point p = new Point(); | |
Random rnd = new Random(); | |
p.X = rnd.Next(pictureBox1.Width); | |
p.Y = rnd.Next(pictureBox1.Height); | |
points.Add(p); | |
pictureBox1.Refresh(); | |
} | |
private void pictureBox1_Paint(object sender, PaintEventArgs e) | |
{ | |
foreach (Point p in points) { | |
e.Graphics.DrawImage(img, p); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment