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 test_Move_Image { public partial class Form1 : Form { public Form1() { InitializeComponent(); } Image map; Bitmap bmp; private void button1_Click(object sender, EventArgs e) { Image img = Image.FromFile(@"c:\MAP_TAS\wash.jpg"); Bitmap tbmp = new Bitmap(img.Width, img.Height); Graphics tgr = Graphics.FromImage(tbmp); tgr.DrawImage(img, 0, 0); map = tbmp; draw_map(); tgr.Dispose(); tbmp.Dispose(); } private void draw_map() { pictureBox1.Image = null; pictureBox1.Image = map; GC.Collect(); GC.WaitForPendingFinalizers(); }
} }
|