Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long Private Sub Command1_Click() Dim w As Integer, h As Integer Me.ScaleMode = vbPixels w = Picture1.Width h = Picture1.Height StretchBlt Me.hdc, 0, 0, w / 2, h / 2, Picture1.hdc, 0, 0, w, h, vbSrcCopy End Sub
多谢了,能给点说明吗?
Private Sub Command1_Click()
Dim w As Integer, h As Integer Me.ScaleMode = vbPixels
w = Picture1.Width
h = Picture1.Height StretchBlt Me.hdc, 0, 0, w / 2, h / 2, Picture1.hdc, 0, 0, w, h, vbSrcCopy
End Sub