Newbie Game Programmers

Moderators: None (Apply to moderate this forum)
Number of threads: 108
Number of posts: 316

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
loading an image to the application Posted by gencoglu27 on 20 Jul 2007 at 2:29 PM
hi,
I am new to C++ and win32 app..
I use VC++ ..I can create some app using MFC wizard ..
***The first thing I want to do is how to add an image to my app
***The second thing is how can I write a "coloured text"
if you give me some examples ,I will be glad..
thanks
Report
Re: loading an image to the application Posted by MT2002 on 2 Aug 2007 at 12:50 AM
: hi,
: I am new to C++ and win32 app..
: I use VC++ ..I can create some app using MFC wizard ..
: ***The first thing I want to do is how to add an image to my app
: ***The second thing is how can I write a "coloured text"
: if you give me some examples ,I will be glad..
: thanks
:

Hello,

Sorry for the late reply, I don't visit this section very often

You can load and display images very easily using the Win32 API.
Simply use ::LoadImage (), to get an HBITMAP. Then, select the
HBITMAP into a offscreen DC, that can be blitted (Using BitBlt() )
to the primary window. Keep in mind, this is very windows specific,
and will not work for other platforms. It is also very slow working
with the Win32 GDI., hence I don't recommend it for any program requiring
speed--such as video games.

Also, keep in mind that graphical images don't work with text modes at all.

You can easily use the Win32 API to also set different colors for
text output. Once more, it is system dependent. settextcolor() can
be found in <conio.h>. Please note, it is not portable.

Because you are still new to C++, I highley recommend not
worring about graphics until you learn OOD concepts, and know how
to impliment them. Graphics programming can get quite complex,
espically if you are still learning the ropes of a language.



[.:EvolutionEngine][.:MicroOS Operating System][Website :: OS Development Series]



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.