tags:

views:

57

answers:

2

On codeproject there is an example of extending the GDI+ Image class to support animated gif under C++

However, under .Net there is ImageAnimator. While looking at ImageAnimator I noticed that they show support under 4 languages including C++. Does that mean ImageAnimator is actually available under C++ as well?

http://msdn.microsoft.com/en-us/library/system.drawing.imageanimator.animate%28VS.71%29.aspx

The reason I ask is, that I don't like reinventing the wheel. Also, the codeproject version is dependant on MFC so if I use that I'll have to strip out the mfc bits. Thought I'd just ask this question before I begin.

+1  A: 

Yes, that is exactly what it means. The MSDN page you linked to even has a C++ example of how to use it.

Andrew Hare
Only if they are building a C++/CLI program that is dependent on the .Net framework. It is not available for native C for Windows (C/C++ without the .Net framework). So by using this, you're replacing one dependency (MFC) with another (.Net).
Joshua
I guess I kind of assumed that they were building a managed C++ app since they asked about a type that is in the .NET framework,
Andrew Hare
Thats a good point Joshua. I'm not sure I want to pull in the whole .NET framework just for one little class...
Matt H
A: 

.Net is just another wrapper of GDI+ flat API. The C++ wrapper of GDI+ flat API is here. You get pretty much the same object model, except .Net has some higher classes that do not exist in low level wrappers. For example, to rewrite the ImageAnimator class in native code you need to create your own wrapper around Image::SelectActiveFrame or GdipImageSelectActiveFrame.

Sheng Jiang 蒋晟