Private Sub Picture1_Paint()
成都創(chuàng)新互聯(lián)公司是一家專注于網(wǎng)站設(shè)計(jì)制作、網(wǎng)站建設(shè)與策劃設(shè)計(jì),灤平網(wǎng)站建設(shè)哪家好?成都創(chuàng)新互聯(lián)公司做網(wǎng)站,專注于網(wǎng)站建設(shè)10多年,網(wǎng)設(shè)計(jì)領(lǐng)域的專業(yè)建站公司;建站業(yè)務(wù)涵蓋:灤平等地區(qū)。灤平做網(wǎng)站價(jià)格咨詢: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 '復(fù)制的圖片,就用這行
End Sub
Vb6只有Label控件可以設(shè)置背景透明,VB.net基本上都可以,可以按住CTRL多選,或者用鼠標(biāo)框選,選中多個(gè)控件后,設(shè)置它們的backcolor屬性為透明,或者用代碼:
For?Each?ctl?As?Control?In?Me.Controls
ctl.BackColor?=?Color.Transparent
Next
窗體或picturebox屬性里設(shè)置雙緩沖
timer1刷新頻率別太高,移動(dòng)像素點(diǎn)可以大點(diǎn)
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
沒問題哦。。