displaying jpegs

just wanna start off by saying that im a little new to windows programming. i have a pretty good understanding of c++ and basic win32. i was wondering, how can i display a jpeg in a window. the basis behind this is that i will have a bitmap background, and then the jpeg image will be "on top" and move around the map.
also, how can i move the jpeg around using the arrow keys

would case wm_keydown :
            {  while(vk_left == true)
                       "jpeg image moves to the left"
            break; 
             }
sorry if it is bad syntax, trying to type this while at work :P

edit: im trying to do this in win32, not directx or opengl...haven't learned that yet.


Answer this question

displaying jpegs

  • James Newman

    The PictureBox is a control for displaying images. Here is a reference to MSDN library about pictureboxes
    The PictureBox class

    I hope this helps.
    Take care.



  • HyperX

    ok thanks, i'll try it
  • ItsMe!!!

    To better equip you I have decided to provide you with links to some resources.
    Loading JPEGS (GDI)
    Loading and displaying Bitmaps (GDI+)

    Armed with these articles you could just essentially use a picture box component on a form if you have access to an IDE, almost all if not all IDE's provide you with a form/window and some controls such as a picture box to handle your kind of scenario. If not check the related links above.


    EDIT: Also check this Win32 FAQ
    I hope this helps.
    Take care.


  • Antonello Bianchi

    thanks, i'll take a look at them and see what i come up with. just a quick question, when you say picture box what exactly do you mean. i'll be making the window from scratch using win32
  • Andrew Li

    one more thing, do i have to define the class , or is it already in windows.h and i can just use the syntax to call an jpeg
  • displaying jpegs