From: Jim Barry on
Grzegorz Wróbel wrote:
> Now, the main problem I have with these methods, either
> OleLoadPicture() or OleLoadPicturePath() is that I really want to
> obtain bitmap bits in RGB format.

The bitmap should already be a 24-bit DIB-section. Call GetObject to fill a DIBSECTION structure, then you can access the image data via dsBm.bmBits.

--
Jim Barry, MVP (Windows SDK)
From: news@rtrussell.co.uk on
Jim Barry wrote:
> The bitmap should already be a 24-bit DIB-section. Call GetObject to fill a DIBSECTION structure, then you can access the image data via dsBm.bmBits.

You've not actually tried it, have you?! It would be really great if
it worked, but unfortunately it doesn't. If you change your display
settings to 16bpp, for example, the object returned by GetObject is a
16-bits DIBSECTION, not 24-bits! This is despite there being no
reference to a DC or a device at all. If you can find a way to make it
work I would love to know, but failing that I would really like an
explanation of why Windows works this apparently crazy way. What have
the display settings got to do with transferring a JPEG from a file to
a DIBSECTION?

Richard.
http://www.rtrussell.co.uk/
To reply by email change 'news' to my forename.

From: Jim Barry on
news(a)rtrussell.co.uk wrote:
> You've not actually tried it, have you?!

Guilty as charged. Actually, I did try it, but didn't think to check it with a 16-bit display setting. I hadn't counted on Windows capping the colour depth to that of the current display mode. Now that's what I call a premature optimisation :-(

I've been through the mill with JPEG stuff before (in particular, the lack of any Windows facility for saving JPEGs) and ended up using the IJG library. Interestingly, the code behind OleLoadPicture is based on the IJG library, too.

--
Jim Barry, MVP (Windows SDK)
From: Jean on
The Independent JPEG Group (IJG) provides a free and open source code
library for compressing and decompressing JPEG images.

The library is written in C, and is designed to be portable between many
compilers and platforms.

The distribution includes the JPEG library proper, plus two application
programs ("cjpeg" and "djpeg") which use the library to convert JPEG
files to and from some other popular image formats.

ftp://ftp.simtel.net/pub/simtelnet/msdos/graphics/jpegsr6.zip



With best regards

____
Jean
From: news@rtrussell.co.uk on
Jean wrote:
> The Independent JPEG Group (IJG) provides a free and open source code
> library for compressing and decompressing JPEG images.
>
> The library is written in C, and is designed to be portable between many
> compilers and platforms.

Is it available as a pre-compiled DLL? That would be really useful (I
mainly program in a language which cannot make use of C source code nor
link to object modules).

Richard.
http://www.rtrussell.co.uk/
To reply by email change 'news' to my forename.