Teen Programmers Unite  
 

 

Return to forum top

Window and picture

Posted by Brok3n_Link [send private reply] at November 30, 2002, 10:04:35 PM

k, C++, i need a window with a picture on it, when it gets clicked it dissapears and the rest of the program runs.
i would, if possible like some starter coe for both. thx

Posted by buzgub [send private reply] at November 30, 2002, 10:52:18 PM

It looks to me like what you're asking for is a tutorial on basic graphical user interface programming. http://www.winprog.org/tutorial if you don't care about portability; otherwise, http://www.wxwindows.org/ or http://www.gtk.org/

Posted by Brok3n_Link [send private reply] at December 02, 2002, 06:16:17 AM

thanks

Posted by Brok3n_Link [send private reply] at December 02, 2002, 06:33:42 AM

ok, how do i paint a picture onto a window with out having the picture(bmp) around? i mean have the bmp imbedded into the program. thx

Posted by buzgub [send private reply] at December 02, 2002, 07:29:02 AM

I believe the normal way to do that is to have a program that takes your bitmap and turns it into a header file that defines a variable that holds the contents of the bitmap. Then, you include the header and use the variable. It's also possible in some (all?) executable formats to put the bitmap data in the executable file, at the end of the file. Then you open the file, fseek() (or equivalent) to that part of your executable, and read the bitmap data.

Posted by CViper [send private reply] at December 02, 2002, 08:47:55 AM

in Win32 you can use resources. Consult you IDE on how to add resources to you .exe's.

then just call
LoadBitmap( NULL, MAKEINTRESOURCE( <id> ) );
where <id> is the resource id of the bitmap

Posted by Brok3n_Link [send private reply] at December 03, 2002, 07:51:07 AM

ah k, thx

You must be logged in to post messages and see which you have already read.

Log on
Username:
Password:
Save for later automatic logon

Register as a new user
 
Copyright TPU 2002. See the Credits and About TPU for more information.