loading an image to the application - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

loading an image to the application

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

Comments

  • MT2002MT2002 Posts: 1,444Member
    : 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 . Please note, it is not portable.

    Because you are still new to C++, I [b]highley[/b] 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.


    [hr][size=1][leftbr].:EvolutionEngine[rightbr][leftbr].:MicroOS Operating System[rightbr][leftbr][link=http://www.mt2002.sitesled.com]Website :: OS Development Series[rightbr][/link][/size]
Sign In or Register to comment.