Одна коробка с картинками сверху Glcontrol внутри панели - PullRequest
0 голосов
/ 02 марта 2020

У меня панель с синим фоном. И нужно добавить glcontrol внутри этой панели. Над этим glcontrol я должен показать прозрачное изображение круга. Я пытался, как показано ниже. Но прозрачность круга отсутствует. Как добавить прозрачное изображение поверх glcontrol?

        this.panel1.BackColor = System.Drawing.Color.DarkTurquoise;
        this.panel1.Controls.Add(this.pictureBox2);
        this.panel1.Controls.Add(this.glControl1);
        this.panel1.Location = new System.Drawing.Point(610, 510);
        this.panel1.Name = "panel1";
        this.panel1.Size = new System.Drawing.Size(200, 178);
        this.panel1.TabIndex = 16;

       // pictureBox2 // CIRCLE IMAGE
        // 
        this.pictureBox2.BackColor = System.Drawing.Color.Transparent;
        this.pictureBox2.Image = global::Prism.Properties.Resources.circle;
        this.pictureBox2.Location = new System.Drawing.Point(54, 69);
        this.pictureBox2.Name = "pictureBox2";
        this.pictureBox2.Size = new System.Drawing.Size(100, 50);
        this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
        this.pictureBox2.TabIndex = 14;
        this.pictureBox2.TabStop = false;
        // 
        // glControl1 
        // 
            this.glControl1.BackColor = System.Drawing.Color.Transparent;
        this.glControl1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
        this.glControl1.Location = new System.Drawing.Point(39, 27);
        this.glControl1.Margin = new System.Windows.Forms.Padding(0);
        this.glControl1.Name = "glControl1";
        this.glControl1.Size = new System.Drawing.Size(304, 205);
        this.glControl1.TabIndex = 0;
        this.glControl1.VSync = false;
        // 

В коде позади,

        glControl1.Controls.Add(pictureBox2);
        pictureBox2.BringToFront();
        glControl1.SendToBack();

enter image description here

...