Thread: Image class - loading image file

  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, 08:18 PM
  2. added start menu crashes game
    By avgprogamerjoe in forum Game Programming
    Replies: 6
    Last Post: 08-29-2007, 01:30 PM
  3. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  4. Post...
    By maxorator in forum C++ Programming
    Replies: 12
    Last Post: 10-11-2005, 08:39 AM
  5. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM