vb6.0 想用VB6.0做一个小程序,输入图片地址。点确认,打开一张网络图片.自动放大三倍,要完整的代码

2024-12-22 12:54:51
推荐回答(2个)
回答1:

Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Private Sub Command1_Click()
Image1.Stretch = False
Dim url$, M$, N$
M = Text1.Text: N = Text2.Text
url = "http://www1.51.com/" & M & "/" & N & "/images/2.gif "
If URLDownloadToFile(0, url, "D:\2.gif", 10, 0) = 0 Then
Image1.Picture = LoadPicture("D:\2.gif")
Image1.Stretch = True
Image1.Width = Image1.Width * 3
Image1.Height = Image1.Height * 3
End If
End Sub

回答2:

图片的处理还是建议使用gdi+