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(f11.name)
    SavePicture oPicture, sFolder & "\temp\" & mid(f11.name, 1, Len
    (f11.name)-1) & ".jpg"
    Set oPicture = Nothing

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

  2. jodleren

    Bob Barrows Guest

    jodleren wrote:
    > 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

    ^^^^^^^^^^^^^^^
    Well, this is certainly not vbscript so I suspect you are using asp.net,
    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

    microsoft.public.dotnet.framework.aspnet.

    There are also forums at www.asp.net where you can find a lot of people
    to help you.



    --
    HTH,
    Bob Barrows
    Bob Barrows, Oct 22, 2009
    #2
    1. Advertising

  3. jodleren

    jodleren Guest

    On Oct 22, 4:46 pm, "Bob Barrows" <> wrote:
    > jodleren wrote:
    > > 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

    >
    >                              ^^^^^^^^^^^^^^^
    > Well, this is certainly not vbscript so I suspect you are using asp.net,
    > in which case:


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

    Bob Barrows Guest

    jodleren wrote:
    > On Oct 22, 4:46 pm, "Bob Barrows" <> wrote:
    >> jodleren wrote:
    >>> 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

    >>
    >> ^^^^^^^^^^^^^^^
    >> Well, this is certainly not vbscript so I suspect you are using
    >> asp.net, in which case:

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


    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
    this:

    Dim oPicture

    Set oPicture = LoadPicture(f11.name)
    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 www.aspfaq.com site to see if Aaron included information
    about binary file conversion.



    --
    HTH,
    Bob Barrows
    Bob Barrows, Oct 22, 2009
    #4
  5. jodleren

    Dan Guest

    "jodleren" <> wrote in message
    news:...
    > 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(f11.name)
    > SavePicture oPicture, sFolder & "\temp\" & mid(f11.name, 1, Len
    > (f11.name)-1) & ".jpg"
    > Set oPicture = Nothing
    >
    > but I probably need an obejct?
    > what do I do wrong?



    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
    Dan, Oct 22, 2009
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Harry Simpson

    32 dpp BMP to 24dpp BMP??

    Harry Simpson, Oct 30, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    336
    Harry Simpson
    Oct 30, 2003
  2. Richard
    Replies:
    3
    Views:
    4,087
    velocity4anil
    Sep 19, 2007
  3. Curt_C [MVP]
    Replies:
    3
    Views:
    14,277
    jharr100
    Aug 14, 2009
  4. Tampa .NET Koder
    Replies:
    0
    Views:
    504
    Tampa .NET Koder
    Jul 27, 2004
  5. =?Utf-8?B?QWRh?=

    GDI+ and SAVE JPG or BMP on the server

    =?Utf-8?B?QWRh?=, Mar 19, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    9,988
Loading...

Share This Page