winfrom 窗体背景

首先在项目属性--》资源  --》添加资源--》添加现有文件即可

  private Image bgImage;
        public Form1()
        {
            InitializeComponent();
            bgImage = new Bitmap(Properties.Resources.shq);
        }
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            e.Graphics.DrawImage(bgImage, this.ClientRectangle, new Rectangle(0, 0, this.bgImage.Width, this.bgImage.Height), GraphicsUnit.Pixel);
        }

label1.BackColor = Color.Transparent;   把lable透明化

原文地址:https://www.cnblogs.com/liufei88866/p/1791316.html