c++使用新的图像 gdi+

发布于 2024-09-15 04:13:49 字数 123 浏览 1 评论 0 原文

我使用 gdi+ 输出图像。
我尝试使用关键字 new 但它不起作用。

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

成熟的代价 2024-09-22 04:13:50

像这样的事情似乎更有可能:

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

除了你很有可能根本不想动态分配 Image 对象 - 除非你真的这样做,否则你通常只想定义一个具有自动存储持续时间的对象:

Image image_object(L"Image Name");

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");
叹梦 2024-09-22 04:13:50

GDI+ Image 类不可默认构造。您必须向构造函数提供一些参数才能创建一个 - 请参阅 此处

您最好使用派生自 Image 的 Gdiplus::Bitmap。如果你想输出它,这似乎更有可能。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文