[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 211
  • Last Modified:

GIF to BMP with Inet Transfer Control?

I'm using the Internet Transfer Control to download images from the internet.

When I'm browsing the web and right-click to download an image, I can choose to save it as .BMP.  Is there an easy way to convert the native JPG or GIF to BMP in visual basic? Either through the control or through another util?

Here's my code:
Private Function GetUpdate() As Integer
On Error GoTo Update_Error
    Dim bData() As Byte
   
    Inet1.AccessType = icUseDefault
   
    bData() = Inet1.OpenURL(strURL, icByteArray)
    Open BMP_PATH & strDatafile & ".bmp" For Binary Access Write As #1
        Put #1, , bData()
    Close #1
   
    GetUpdate = -1
   
    Exit Function
Update_Error:
    GetUpdate = 0
    Exit Function
End Function

0
rgroves
Asked:
rgroves
  • 2
1 Solution
 
mcriderCommented:
You can load the JPG or GIF into a picture control with the LoadPicture statement and then save the picture with the SavePicture statement.

The picture will automatically be saved as a BMP...


Cheers!
0
 
rgrovesAuthor Commented:
Worked perfectly, thanks!!
0
 
mcriderCommented:
Thanks for the points! Glad I could Help!


Cheers!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now