7,763
社区成员
发帖
与我相关
我的任务
分享
Option Explicit
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()
Call StretchBlt(Picture2.hdc, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeight, Picture1.hdc, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight, &HCC0020)
End Sub
Private Sub Form_Load()
Picture1.AutoSize = True
Picture1.AutoRedraw = True
Picture1.ScaleMode = 3
Picture1.Visible = False
Picture1.Picture = LoadPicture("c:\123.JPG")'事先加载一张图片
Picture2.ScaleMode = 3
Picture2.Visible = True
End Sub
Option Explicit
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 Form_Click()
Dim lngP As Long
Picture2.Cls
lngP = StretchBlt(Picture2.hdc, 0, 0, Picture2.ScaleWidth \ 15, Picture2.ScaleHeight \ 15, Picture1.hdc, 0, 0, Picture1.ScaleWidth \ 15, Picture1.ScaleHeight \ 15, vbSrcCopy)
End Sub
Private Sub Form_Load()
Picture1.AutoSize = True
Picture2.AutoRedraw = True
Picture1.Picture = LoadPicture("C:\1.bmp")
End Sub
Me.Height = Picture1.Top + Picture1.Height + 480
Me.Width = Picture1.Left + Picture1.Width + 210
If Me.Height <= 4620 Then Me.Height = 4620
If Me.Width <= 3015 Then Me.Width = 3015
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2