Printing JPG bitmap

I need to print jpg files, the following
code works with bmp files but not jpg.  Thank you in advance.

LPCTSTR thebmp;
thebmp="c:\\nameit.jpg";
CBitmap bjg;
bjg.Attach(::LoadImage(NULL,thebmp,IMAGE_BITMAP,0,0,LR_LOADFROMFILE|LR_DEFAULTSIZE));
CPoint p;
p.x=100;
p.y=100;
CSize s;
s.cx=1700;
s.cy=1400;
pDC->DrawState(p,s,&bjg,NULL,NULL);
CRecordView::OnPrint(pDC, pInfo);
binstarAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

bbousquetCommented:
I'm pretty sure LoadImage works with BMP files only (well, icons and cursors too). Therefore if I'm not mistaken you'll have to get a hold of a picture conversion package (maybe Win32 can do something about that but I don't think LoadImage will load a JPG (or GIF, TIF, etc.) by itself.
0
hongjunCommented:
Can you list down what header files have you included?

hongjun
0
hongjunCommented:
Can you list down what header files have you included?

hongjun
0
AlexVirochovskyCommented:
LoadImage don't work with jpg. You need
specific code for this. There are many
free source, see, for example,
            CImage Class for RAW, JIFF, GIF, JPG, PNG
http://www.visualc.com/default.asp?activex=&web=Download&lang=en&htype=&dlname=cimage.zip
            Nviewlib - Jpeg, GIF, BMP, RLE, DIB, PCX, TGA viewer DLL
http://home.att.net/~knishita/nviewlib.htm
 Or
            //See GIF/JPG files
http://www.vsce.com/src_code/faq_source_code.html
http://www.ijg.org
or PaintLib
www.paintlib.de , www.paintlib.com
Or
home.wxs.nl/~flvdberg
Or ...
0
AlexVirochovskyCommented:
You don't react!
For this i think, that one of those
URL helps you.
Alex
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Graphics Software

From novice to tech pro — start learning today.