Skip to content

Instantly share code, notes, and snippets.

@yashihei
Created July 18, 2014 05:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yashihei/a6819b32e01b84128cfd to your computer and use it in GitHub Desktop.
Save yashihei/a6819b32e01b84128cfd to your computer and use it in GitHub Desktop.
てくなんず
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