views:

35

answers:

2

im using gdi+ to output my images.
i tried to use the keyword new but it didn't work.

shot(L"image name") = new Image;

that didn't work any other ideas how to make it work

A: 

Something like this seems a lot more likely:

Image *image_object = new Image(L"Image Name");

Except that there's a pretty decent chance you don't want to allocate the Image object dynamically at all -- unless you really do, you generally want to just define an object with automatic storage duration:

Image image_object(L"Image Name");
Jerry Coffin
it didn't work.
Ramiz Toma
nvm it worked..
Ramiz Toma
A: 

The GDI+ Image class is not default constructible. You have to supply some parameters to the constructor in order to create one - see here.

You may well be better off using Gdiplus::Bitmap, which derives from Image. That seems more likely if you're trying to output it.

Peter