Use VB 6 to resize jpg and save resized file


I would like to be able to load in a jpg image, resize it with visual basic (I'm using version 6) and then save the resized image back out as a jpg.  Any ideas?

Thank you.

Who is Participating?

Improve company productivity with a Business Account.Sign Up

wesbirdConnect With a Mentor Commented:
There is a better way to do it if you don;t want to "shell".

Take a look at

You can get the jpg into a DIB object and then do something like this:

    Dim dib As New cDIBSection
    Dim dibThumbnail As cDIBSection
    If LoadJPG(dib, strSrc) Then
        Set dibThumbnail = dib.Resample(Y, X)
        If SaveJPG(dibThumbnail, strDest) Then
            blnSuccess = True
        End If
    End If
I did something similar and used the imagemagik suite - which are basically a bunch of command line image manipulation tools ... which you can use them from VB using the shell command.

You can do loads of stuff, such as converting, resizing, rotating etc ...

hope this helps

ksmAuthor Commented:

Thank you for pointing me to the tools.  It seems like a robust package with some very cool features.  I chose wesbird's answer, though, because it seemed a little more seemless and I needed to get something up and running very quickly.


Thank you very much.  I was able to get the code up and running with only minor tweaking.  Easy to integrate.  Worked like a champ.


P.S. You can get a later version of the DLL from  I've been using this one for several months in my app (must have processed 30000 images by now) with no problems.  The version ilj11.dll did bug on about the 5000th image which is why I recommend using ijl15.dll - that one is stable.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.