Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Converting BMP to JPG

1 view
Skip to first unread message

jodleren

unread,
Oct 22, 2009, 9:29:28 AM10/22/09
to
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?

Bob Barrows

unread,
Oct 22, 2009, 9:46:45 AM10/22/09
to
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


jodleren

unread,
Oct 22, 2009, 10:03:36 AM10/22/09
to
On Oct 22, 4:46 pm, "Bob Barrows" <reb01...@NOyahoo.SPAMcom> 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?

Bob Barrows

unread,
Oct 22, 2009, 10:28:22 AM10/22/09
to

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


Dan

unread,
Oct 22, 2009, 1:33:07 PM10/22/09
to

"jodleren" <son...@hot.ee> wrote in message
news:f8e63e1e-748e-4630...@h2g2000vbd.googlegroups.com...


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

0 new messages