Author Topic: C++ - how use GDIPLUS?  (Read 5352 times)

Offline cambalinho

  • Multiple posting newcomer
  • *
  • Posts: 93
C++ - how use GDIPLUS?
« on: September 22, 2014, 11:29:48 am »
- i had the include:
#include <.\gdiplus\gdiplus.h>

- and the libgdiplus.h to the linker options.
i never used GDIPLUS in C++. but i'm trying it:

Code
hdcimage = CreateCompatibleDC(NULL);
            Gdiplus::Graphics graphics(hdcimage); //Handle to the device context
            //Load the image from a file
            Gdiplus::Image img(filename.c_str());//error
            graphics.DrawImage(&img, 0, 0, img.GetWidth(), img.GetHeight());
the 'filename' it's a c++ string.
i get 1 error:
"no matching function for call to 'Gdiplus::Image::Image(const char*)'"
can anyone tell me what i'm doing wrong?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: C++ - how use GDIPLUS?
« Reply #1 on: September 22, 2014, 11:59:35 am »
Please respect our forum rules !
Especially:
[...]
1. This is NOT a general programming board. "How do I write a program that....", "Can anybody teach me how to", "I have this homework", "My program doesn't run and I don't have the slightest idea of why because I'm a C++ newcomer", "What is a compiler", "What does gcc do" is the kind of questions that is FORBIDDEN to ask.

2. Compiler/Linker errors are NOT Code::Blocks errors. Usually, C++ newcomers tend to confuse the Editor/IDE (Code::Blocks) with the Compiler (MINGW / GCC). You may see some errors in the compiler output because you missed to do something right in your code. But that's not Code::Blocks troubleshooting, that's C++ troubleshooting and does not belong in here. If your program doesn't compile, READ THE C++ MANUAL.

3. Is your problem library, framework specific? There are appropriate forums for it, not the Code::Blocks forum.
[...]
Thank you.

Finale note: Ignoring these rules may result in the topic being (silently) locked and/or even removed completely without any notice.

In case you wonder why we are so strict: I could say: "Search the forum" - as this has been discussed a lot. To make is short: By law we (the devs/moderators) are responsible for the content of our forum. This means we need to read all posts. If you want us to continue the development of C::B and have the time to answer some of the questions that are really related to C::B, apply the rules above. It's obviously a matter of time for us.
[...]

Topic locked !!