开发者

c++ use new to Image gdi+

开发者 https://www.devze.com 2023-01-11 23:36 出处:网络
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;

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


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");


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消