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 Ex01_10
{
    public partial class Form1 : Form
    {
        Bitmap Mybitmap;     //公用变量

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            Mybitmap = new Bitmap("mytext.png");

            Mybitmap.MakeTransparent(Color.Blue);
            this.Left = (SystemInformation.PrimaryMonitorMaximizedWindowSize.Width - this.Width)/2;
            this.Top = (SystemInformation.PrimaryMonitorMaximizedWindowSize.Height - this.Height)/2;
        }
        protected override void OnPaint(PaintEventArgs e)
        {
            e.Graphics.DrawImage((Image)Mybitmap, new Point(1, 1));
        }

        private void Form1_DoubleClick(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
