Private Sub Picture1_Paint()
成都创新互联公司是一家专注于网站设计制作、网站建设与策划设计,滦平网站建设哪家好?成都创新互联公司做网站,专注于网站建设10多年,网设计领域的专业建站公司;建站业务涵盖:滦平等地区。滦平做网站价格咨询:18982081108
Dim l As Long, t As Long
l = (Picture1.Width - Picture1.ScaleWidth) / 2 '求左右边偏差
t = (Picture1.Height - Picture1.ScaleHeight) / 2 '求上下边偏差
Picture1.PaintPicture Me.Picture, 0, 0, , , Picture1.Left + l, Picture1.Top + t, Picture1.ScaleWidth, Picture1.ScaleHeight '载入图片,就用这行
'Picture1.PaintPicture Me.Image, 0, 0, , , Picture1.Left + l, Picture1.Top + t, Picture1.ScaleWidth, Picture1.ScaleHeight '复制的图片,就用这行
End Sub
Vb6只有Label控件可以设置背景透明,VB.net基本上都可以,可以按住CTRL多选,或者用鼠标框选,选中多个控件后,设置它们的backcolor属性为透明,或者用代码:
For Each ctl As Control In Me.Controls
ctl.BackColor = Color.Transparent
Next
窗体或picturebox属性里设置双缓冲
timer1刷新频率别太高,移动像素点可以大点
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Label1.BackColor = System.Drawing.Color.Transparent
End Sub
没问题哦。。