using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace test06 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Bitmap bitmap_out = new Bitmap(6376, 10805, System.Drawing.Imaging.PixelFormat.Format32bppArgb); Bitmap bitmap_out2 = new Bitmap(6376, 10805, System.Drawing.Imaging.PixelFormat.Format32bppArgb); //※2 Graphics graphics = Graphics.FromImage(bitmap_out); for (int i = 0; i < bitmap_out.Width; i += 50) { graphics.DrawLine(Pens.Black, i, 0, i, bitmap_out.Height); } for (int i = 0; i < bitmap_out.Height; i += 50) { graphics.DrawLine(Pens.Black, 0, i, bitmap_out.Width, i); } graphics.Dispose(); if (this.pictureBox1.Image != null) { this.pictureBox1.Image.Dispose(); } this.pictureBox1.Image = null; //this.pictureBox1.Image = new Bitmap(bitmap_out); //bitmap_out.Dispose(); this.pictureBox1.Image = bitmap_out; } } }