WinForms透明图片框无法正常工作

时间:2015-05-04 23:46:58

标签: c# .net winforms

我一直试图在背景上以黑色/灰色放置图像,我希望背景能够透过图像的透明部分显示出来。图像肯定正确保存为透明png。下面的代码有什么问题?

this.pictureBox14.BackColor = System.Drawing.Color.Transparent;
this.pictureBox14.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBox14.BackgroundImage")));
this.pictureBox14.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
this.pictureBox14.Cursor = System.Windows.Forms.Cursors.Hand;
this.pictureBox14.Location = new System.Drawing.Point(486, 337);
this.pictureBox14.Name = "pictureBox14";
this.pictureBox14.Size = new System.Drawing.Size(69, 62);
this.pictureBox14.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.pictureBox14.TabIndex = 18;
this.pictureBox14.TabStop = false;
this.pictureBox14.Click += new System.EventHandler(this.pictureBox14_Click);

0 个答案:

没有答案