For Programmers: Free Programming Magazines  


Home > Archive > VC Language > May 2006 > Conversion from jpg to bmp libraries









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Conversion from jpg to bmp libraries
Jack

2006-05-26, 4:13 am

blush... here i come again.
I'd like to programmtically convert a jpg image to
bmp in memory or to files.
Are there any good libraries for VC++ or Java?
Thanks
Jack


IanM

2006-05-26, 4:13 am


"Jack" <jl@knight.com> wrote in message
news:eUvkJlJgGHA.4864@TK2MSFTNGP05.phx.gbl...
> blush... here i come again.
> I'd like to programmtically convert a jpg image to
> bmp in memory or to files.
> Are there any good libraries for VC++ or Java?
> Thanks
> Jack
>
>


this is a good place to start

http://www.ijg.org/


Jack

2006-05-26, 4:13 am


"IanM" <i_m_@j_v_f_.co.uk> ¼¶¼g©ó¶l¥ó·s»D:OMMkGzJgGHA.1272@TK2MSFTNGP03.phx.gbl...
>
> "Jack" <jl@knight.com> wrote in message
> news:eUvkJlJgGHA.4864@TK2MSFTNGP05.phx.gbl...
>
> this is a good place to start
>
> http://www.ijg.org/
>

Hi IanM,
Thanks for the info. I will go ahead and try to recompile them. Thanks a
lot. Bye bye
Jack


Alex Blekhman

2006-05-28, 4:11 am

Jack wrote:
> blush... here i come again.
> I'd like to programmtically convert a jpg image to
> bmp in memory or to files.
> Are there any good libraries for VC++ or Java?


"Displaying a JPG in your MFC Application"
http://msdn.microsoft.com/msdnmag/i.../c/default.aspx

Here's quick and dirty example:

----------------
#include <windows.h>
#import <olepro32.dll>

int _tmain(int /*argc*/, _TCHAR* /*argv*/[])
{
::OleInitialize(NULL);

_variant_t vtPath(L"C:\\Temp\\Cool.jpg");

IDispatchPtr ptrDisp;

HRESULT hr = ::OleLoadPictureFile(vtPath, &ptrDisp);

if(SUCCEEDED(hr))
{
IPicturePtr ptrPicture(ptrDisp);

OLE_HANDLE hBmp = NULL;
ptrPicture->get_Handle(&hBmp);

if(hBmp)
{
BITMAP bm = { 0 };
int nRet = ::GetObject((HANDLE)hBmp,
sizeof(BITMAP), &bm);

if(nRet)
{
// use BITMAP
}
}
}

::OleUninitialize();

return 0;
}
---------------

HTH
Alex


Mark Randall

2006-05-28, 7:13 pm

Gdiplus will do that for you.

--
- Mark Randall
http://www.temporal-solutions.co.uk

"We're Systems and Networks..."
"It's our job to know..."

"Jack" <jl@knight.com> wrote in message
news:eUvkJlJgGHA.4864@TK2MSFTNGP05.phx.gbl...
> blush... here i come again.
> I'd like to programmtically convert a jpg image to
> bmp in memory or to files.
> Are there any good libraries for VC++ or Java?
> Thanks
> Jack
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com