建立字体形状窗体

Posted on 2018-12-12 23:48  努力成长静待花开  阅读(194)  评论(0编辑  收藏  举报

实现效果:

  

知识运用:

  重写窗体的OnPint方法 对窗体进行重绘 最后设置透明色

实习代码: 

        private void Form1_Load(object sender, EventArgs e)
        {
            bit = new Bitmap(Properties.Resources.poetry);
            bit.MakeTransparent(Color.Wheat);
        }
        protected override void OnPaint(PaintEventArgs e)
        {
            e.Graphics.DrawImage(bit,new Point(0,0));
        }