Ejemplo n.º 1
0
        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            OpenFileDialog o = new OpenFileDialog();

            o.Filter = "Png files|*.png|jpeg files|*.jpg|bitmaps|*.bmp";
            Image i;

            if (o.ShowDialog() == DialogResult.OK)
            {
                i = (Image)Image.FromFile(o.FileName).Clone();
                using (Graphics g = Graphics.FromImage(bmp))
                {
                    g.FillRectangle(new SolidBrush(Color.White), new Rectangle(0, 0, paintZone.Width, paintZone.Height));
                    g.DrawImageUnscaledAndClipped(i, new Rectangle(0, 0, paintZone.Width, paintZone.Height));
                }
                paintZone.Refresh();
            }
        }