Solved

Load JPEG from Resource and convert it to HBITMAP --- Help me plz.

Posted on 2004-09-05
3
559 Views
Last Modified: 2013-12-03
I develope game in PPC by eVc4.0++ . I use Game API(GAPI) in my developement. I would like to used JPEG format for my picture in my game because size of it. I am currently trying to used CxImage Library.

CxImage *newImage=new CxImage();
if (!newImage->LoadResource(FindResource(g_hInst,MAKEINTRESOURCE(IDR_JPG2),_T("JPG")),CXIMAGE_FORMAT_JPG)){
            delete newImage;
            newImage =NULL;
            return ;
      }
HANDLE hDIB = newImage->CopyToHandle();

it give me HANDLE. I try to cast it to HBITMAP ---> HBITMAP hBitmap=(HBITMAP)hDIB;

I think it  wrong. T_T

Can anyone give me a brief explanation of how to load JPEG from Res(evc4.0++) and convert it to HBITMAP ??

Also some tutorials would be helpful considering this is the first game i am trying to create.  Thanks in advance.
0
Comment
Question by:piesoft
3 Comments
 
LVL 8

Accepted Solution

by:
mxjijo earned 500 total points
ID: 11998364

Take a look at this link.. I hope that would help.
http://www.crispen.org/src/archive/0007.html

~j
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
File Watcher and Deleter with Email notification 5 115
Messagebox for a Web Site Application 4 81
Windows ICD FFU Issue 4 87
Visual Studio hangs on running project 6 55
This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question