Jump to content
Sign in to follow this  
darkranger

Save Gambar Dari Webpage

Recommended Posts

ok aku dah tau dah...

penat carik kat planetsourcecode.com

ni aku dah ringkaskan kalau korang nak try

1. buat program baru macam biasa, ada satu command button

2. tambah komponen baru Inet1

-----> Project-Components-Microsoft Internet Transfer Control

3. taip coding ni

Private Sub Command1_Click()

myUrl = "http://www.geocities.com/viewmalaysia/river.jpg"

myFile = "c:\river.jpg"

Dim myData() As Byte

myData() = Inet1.OpenURL(myUrl, icByteArray)

Open myFile For Binary Access Write As #1

Put #1, , myData() cool.gif

Close #1

MsgBox "Download Completed", vbInformation, "Thank you"

End Sub

4. lepas dpt mesej download complete, bukak fail c:\river.jpg

wassalam...

Share this post


Link to post
Share on other sites

huh? unsure.gifblink.gifhuh.gif

lg la aku xpaham... pasal kalau setakat nak buat mcm tu... buat apa nak menyusahkan diri pdhal ada cara lain yg jauh lg mudah... lain la kalau buat program yg boleh save gambar dr webpage (tapi... klik kanan>save this picture @ klik file>save as pun lagi senang...).. aku betul2 xpaham kenapa ko tanya mcmmana nak buat n kenapa mesti buat... blink.gifblink.gifunsure.gif

Share this post


Link to post
Share on other sites

sebab aku buat satu program yang automatik download fail gambar ni setiap 3 saat...

http://images.earthcam.com/ec_metros/ourcams/fridays.jpg

apa yg korang dapat ialah.... gambar suasana times square, new york secara live 24 jam sehari.

pseudocode utk program ni.

1. download gambar dari website tadi dan save ke dalam file cth c:\fridays.jpg dgn coding VB di atas.

2. bila download complete, buka gambar tadi dgn picturebox. Gunakan Inet1.StillExecuting=False utk pastikan download telah complete

3. buat timer utk repeat proses di atas setiap 3 saat

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...