Converting BMP to JPG

Discussion in 'ASP General' started by jodleren, Oct 22, 2009.

  1. jodleren

    jodleren Guest

    Hi all

    I found an example how to convert an BMP file to JPG, but it does not
    work - I cannot find much about it

    The current code is

    Dim oPicture as StdPicture
    Set oPicture = LoadPicture(
    SavePicture oPicture, sFolder & "\temp\" & mid(, 1, Len
    ( & ".jpg"
    Set oPicture = Nothing

    but I probably need an obejct?
    what do I do wrong?
    jodleren, Oct 22, 2009
    1. Advertisements

  2. jodleren

    Bob Barrows Guest

    Well, this is certainly not vbscript so I suspect you are using,
    in which case:

    There was no way for you to know it (except maybe by browsing through
    some of the previous questions before posting yours - always a
    recommended practice), but this is a classic (COM-based) asp newsgroup.
    ASP.Net is a different technology from classic ASP. While you may be
    lucky enough to find a dotnet-savvy person here who can answer your
    question, you can eliminate the luck factor by posting your question to
    a newsgroup where the dotnet-savvy people hang out. I suggest


    There are also forums at where you can find a lot of people
    to help you.
    Bob Barrows, Oct 22, 2009
    1. Advertisements

  3. jodleren

    jodleren Guest

    I got the example from this NG - I am usung asp (without .net), so I
    need another solution.... any ideas?
    jodleren, Oct 22, 2009
  4. jodleren

    Bob Barrows Guest

    That solution will not run in ASP. vbscript does not support typed
    variables. In order to run this in ASP you would at least have to do

    Dim oPicture

    Set oPicture = LoadPicture(
    Neither LoadPicture nor SavePicture are vbscript methods so you will at
    least need to instantiate an object that has those methods. Did the
    solution you got from this newsgroup provide that information? If not,
    you need to go back to google. I've never had to do this type of task so
    I can't help you without resorting to google myself. Actually, you might
    start at the site to see if Aaron included information
    about binary file conversion.
    Bob Barrows, Oct 22, 2009
  5. jodleren

    Dan Guest

    This is Visual Basic 6 code, and will not run in VBScript ASP. You could
    create an ActiveX DLL (COM DLL) in VB6 using similar code in a method and
    compile it to a DLL, install that on your web server (assuming you are
    allowed to install DLLs on the server), and then call the DLL with the
    appropriate parameters for your method. But I would suspect it might be
    easier for you to install an existing commercial (or free) image conversion
    component, or if your site is not your own check with the hosting company to
    see if they already have something installed which will allow you to this.
    Dan, Oct 22, 2009
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.