How can I load a jpg into a CBitmap where I am using visual c++ 6.0 and don’t have access to CImage?
thx
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There’s no native way I know of. I’ve always used FreeImage for JPGs and PNGs – it’s robust and there’s example code in the FAQ on how to load a PNG into an HBITMAP (which works exactly the same for a JPG).
One word of warning from experience – if you’re storing your JPG as a resource, make sure you create a “JPG” resource type and store it as that, don’t try and add it as a BITMAP resource or you’ll have all sorts of problems trying to load it. I know it sounds obvious but it took me a while to figure out.