Thread: hope this is the right forum... mfc graphics question

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    18

    hope this is the right forum... mfc graphics question

    I have NEVER done any graphics work in c++, and am trying to in my first application.

    I have a picture control in my dialog that idealy would be filled with a picture i specify. However, i don;t know how.

    I imagine that somehow i am going to have to set the filename of the picture, then draw the picture.

    I have my picture control set up as a frame, and it has a member variable assigned to it (CStatic).

    I am going to have an edit box where the filename is going to come from, and it may or may not change as the program runs. Is this possible?

    I have, as i said , no experience. And all the tutorials i have found online have either been not what i need or too far above my head.

    Oh, and one final wrinke. They may not be bitmaps, they may be gifs or jpgs as well.

    thanks for help in advance.
    cow
    cow

  2. #2
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    There is not native support in the Win32 API for .gif or .jpg encoding types. If you are assuming this, then you will fail.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  3. #3
    Registered User
    Join Date
    Feb 2002
    Posts
    18
    no, i am not assuming this. but thanks for the help.

    cow
    --still on my way to a 99 average.
    cow

  4. #4
    Registered User
    Join Date
    Jun 2003
    Posts
    245
    I'd try and display a BMP file first, and once you have that working, then progress to JPG and GIF if you wish. How you handle these files are all completely different, but BMP is the easiest, so best to start with.

  5. #5
    Registered User
    Join Date
    Feb 2002
    Posts
    18
    exactly what i would like to do. I found a msdn article which makes displaying other formats easy, but again, this assumes that you know the basics, which i do not. i tried to go on what i gleaned out of the article from msdn but it did not work. thanks for the help so far.

    cow
    cow

  6. #6
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    If you're sure you're going to use MFC, then you'll have better luck with the Windows forum.

    Maybe somebody here can suggest a graphics library that will display or convert a gif or jpeg to a bitmap???

    If you want to write your own conversion program, you can find information on the gif and jpeg formats (as well as bitmap) at wotsit.org. (But, these formats can get rather complicated... and somebody's done it before!)

  7. #7
    Registered User
    Join Date
    Feb 2002
    Posts
    18
    thanks. as i said, i was not sure if this was the original forum. i will jump over to the windows forum and post again. But everyone else, please feel free to continue to provide help

    cow
    cow

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. non-MFC DLL with MFC app question.
    By Kempelen in forum Windows Programming
    Replies: 10
    Last Post: 08-20-2008, 07:11 AM
  2. General forum question - if in wrong forum...
    By ulillillia in forum A Brief History of Cprogramming.com
    Replies: 28
    Last Post: 05-14-2007, 05:00 AM
  3. Noobish question about graphics
    By ThWolf in forum Game Programming
    Replies: 5
    Last Post: 09-01-2006, 11:40 AM
  4. MFC doc/view question
    By RND in forum Windows Programming
    Replies: 0
    Last Post: 01-12-2002, 01:12 AM
  5. MFC Question
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 01-11-2002, 07:19 PM