0
我目前正试图把笔记放在工作人员图像的顶部。但是,备注背景正在设置为表单背景,如图所示。 使用的图像类型是PNG。c#覆盖另一个图像
//class music staff
public MusicStaff(int xLoc, int yLoc, int xSize, int ySize)
{
this.SetBounds(xLoc, yLoc, xSize, ySize);
this.Visible = true;
ResourceManager rm = Resources.ResourceManager;
Bitmap bmp = (Bitmap)rm.GetObject("Staff1");
this.BackgroundImage = bmp;
this.BackgroundImageLayout = ImageLayout.Stretch;
this.BackColor = Color.White;
//adding the background pic
panel4 = new MusicStaff(3, 62, 927, 150);
//adding a note
MusicNote p = new MusicNote(pitch, duration, shape, s);
p.SizeMode = PictureBoxSizeMode.StretchImage;
p.BackColor = Color.Transparent;
p.Size = new Size(50, 75);
p.Location = new Point(xCounter + starterX, NoteLocations.c0.mainPoint);
Bitmap myImage = (Bitmap)rm.GetObject(shape);
p.Image = myImage;
发表任何代码,因此每个人都可以知道从哪里开始帮助 –
ok代码已添加 – christine
该代码看起来有点被截断,这通常很好,但在这种情况下,我需要更多一点才能获得一些更多的上下文,看看究竟发生了什么。 –