Image class - loading image file

This is a discussion on Image class - loading image file within the Windows Programming forums, part of the Platform Specific Boards category; Hi! I'm using GDI+ functions to load jpg file. If I use this "Image *image = new Image(L"C:\icons.jpg", false);" then ...

  1. #1
    Code Warrior
    Join Date
    Nov 2001
    Posts
    669

    Image class - loading image file

    Hi!

    I'm using GDI+ functions to load jpg file.

    If I use this "Image *image = new Image(L"C:\\icons.jpg", false);" then the image variable is always null. Why?

    And remember, icons.jpg is on the right path "C:\icons.jpg".
    Current projects:
    1) User Interface Development Kit (C++)
    2) HTML SDK (C++)
    3) Classes (C++)
    4) INI Editor (Delphi)

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Did you GdiplusStartup before window creation (with corresponding call to GdiplusShutdown when done with your app)?
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  3. #3
    Code Warrior
    Join Date
    Nov 2001
    Posts
    669
    Goody! It works now. The problem was, that I didn't use the GDI+ startup and shutdown method.

    Thanks!
    Current projects:
    1) User Interface Development Kit (C++)
    2) HTML SDK (C++)
    3) Classes (C++)
    4) INI Editor (Delphi)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 09:18 PM
  2. added start menu crashes game
    By avgprogamerjoe in forum Game Programming
    Replies: 6
    Last Post: 08-29-2007, 02:30 PM
  3. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 01:13 AM
  4. Post...
    By maxorator in forum C++ Programming
    Replies: 12
    Last Post: 10-11-2005, 09:39 AM
  5. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 07:39 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21