Picture box transparency in vb

故事扮演 提交于 2019-12-06 15:35:56

I assume you're overlapping a PictureBox over some other control and expecting to see through the PictureBox. That's not how it works - controls with transparent backgrounds are only transparent relative to their parent, not other controls. You could draw them using GDI+ by overriding the OnPaint method of your form:

Private Shared ReadOnly SomeImage As Image = My.Resources.blah 'Get your image somewhere

Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
    Dim g As Graphics = e.Graphics

    g.DrawImage(SomeImage, xCoordinate, yCoordinate)

    'Draw as many images or text as you want.
End Sub

Also, it seems that people are mostly looking for this functionality to make a game. Are you making a game? Please learn graphics before making a game if this is the case. There are many good tutorials out there.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!