- 265 名前:デフォルトの名無しさん mailto:sage [2010/02/08(月) 18:40:07 ]
- private void Form1_Load(object sender, EventArgs e)
{ //画像を当てはめ色を塗る pictureBox1.Image = new Bitmap( pictureBox1.ClientSize.Width, pictureBox1.ClientSize.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb); Graphics g1 = Graphics.FromImage(pictureBox1.Image); g1.FillRectangle(Brushes.AliceBlue, pictureBox1.ClientRectangle); g1.Dispose(); pictureBox2.Image = new Bitmap( pictureBox2.ClientSize.Width, pictureBox2.ClientSize.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb); Graphics g2 = Graphics.FromImage(pictureBox2.Image); g2.FillRectangle(Brushes.Aqua, pictureBox2.ClientRectangle); g2.Dispose(); } private void button1_Click(object sender, EventArgs e) { //コピー処理 Graphics g = Graphics.FromImage(pictureBox1.Image); g.DrawImage(pictureBox2.Image, pictureBox2.Location); g.Dispose(); pictureBox2.Visible = false;//同じ位置とのことなので非表示にしてみる } private void pictureBox2_Click(object sender, EventArgs e) { //コピーが行われたことをわかりやすくするためにとりあえず MessageBox.Show("pictureBox2がクリックされました"); }
|

|