From: Giovanni Dicanio on
"Peter Olcott" <NoSpam(a)OCR4Screen.com> ha scritto nel messaggio
news:_Nadnak4gcGfpBHWnZ2dnUVZ_oCdnZ2d(a)giganews.com...

>> Did you link with gdiplus.lib ?
>
> No, I thought that it would already know its own libraries.
> Do you know the syntax for this?
>
> cl -EHsc -O2 -linkgdiplus.lib %1.cpp
> The above is one of several ways that it does not work.

In compilable code I posted above, I used a #pragma:

#pragma comment(lib, "gdiplus.lib")

Giovanni


From: Giovanni Dicanio on
"Peter Olcott" <NoSpam(a)OCR4Screen.com> ha scritto nel messaggio
news:svydnY0mtcxgpxHWnZ2dnUVZ_oWdnZ2d(a)giganews.com...

>> This code compiles fine with VS2008 SP1 (note that GetEncoderClsid body
>> is required):
>
> Yes, I wonder why they left that out? They should have at least provided a
> link if it is not in the library.

It's a documentation error.
I agree with you.

Giovanni


From: Joseph M. Newcomer on
I fail to understand the problem here. The transformation is generally trivial; anything
a C example initializes in WinMain, you would initialize in the OnInitInstance handler of
your app. This is elementary MFC.
joe

On Mon, 1 Mar 2010 15:06:39 -0600, "Peter Olcott" <NoSpam(a)OCR4Screen.com> wrote:

>All of the links that I have found say they are showing you
>how to use GDI+ from C++, by they actually show you how to
>use GDI+ from C, not C++. For example they show you how to
>modify the WinMain() function. There is no WinMain()
>function in my MFC code.
>
>I want to be able to load and save PNG files and BMP files.
>Since Windows now does this, I would prefer to use Windows
>instead of any third party library.
>
Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
From: Tom Serface on
I use GDI+ from C++ and it works just fine if you do, as many have
suggested, include the right libs. I also use the CImage class:

http://msdn.microsoft.com/en-us/library/bwea7by5(VS.80).aspx

that does a lot of the work for you. There are lots of interesting articles
on the web about this ATL class. I find it very easy to use. It supports
the same image types as GDI+ as you'd expect.

Tom

"Peter Olcott" <NoSpam(a)OCR4Screen.com> wrote in message
news:W7mdncFCK47CsRHWnZ2dnUVZ_v-dnZ2d(a)giganews.com...
> All of the links that I have found say they are showing you how to use
> GDI+ from C++, by they actually show you how to use GDI+ from C, not C++.
> For example they show you how to modify the WinMain() function. There is
> no WinMain() function in my MFC code.
>
> I want to be able to load and save PNG files and BMP files. Since Windows
> now does this, I would prefer to use Windows instead of any third party
> library.
>
From: Peter Olcott on

"Tom Serface" <tom(a)camaswood.com> wrote in message
news:Ols4NLouKHA.3896(a)TK2MSFTNGP02.phx.gbl...
>I use GDI+ from C++ and it works just fine if you do, as
>many have suggested, include the right libs. I also use
>the CImage class:
>
> http://msdn.microsoft.com/en-us/library/bwea7by5(VS.80).aspx
>
> that does a lot of the work for you. There are lots of
> interesting articles on the web about this ATL class. I
> find it very easy to use. It supports the same image
> types as GDI+ as you'd expect.
>
> Tom

The main thing (and possibly the only thing) that I need
from GDI+ is to read and write PNG files.

>
> "Peter Olcott" <NoSpam(a)OCR4Screen.com> wrote in message
> news:W7mdncFCK47CsRHWnZ2dnUVZ_v-dnZ2d(a)giganews.com...
>> All of the links that I have found say they are showing
>> you how to use GDI+ from C++, by they actually show you
>> how to use GDI+ from C, not C++. For example they show
>> you how to modify the WinMain() function. There is no
>> WinMain() function in my MFC code.
>>
>> I want to be able to load and save PNG files and BMP
>> files. Since Windows now does this, I would prefer to use
>> Windows instead of any third party library.
>>