I refer to other answers and comments why your code did not compile.
What I want to mention is that you do not need the std::vector
if you have only one bitmap.
Create the bitmap directly on the stack
Gdiplus::Bitmap bitmap(L"images.png");
nWidth = bitmap.GetWidth();
nHeight = bitmap.GetHeight();
graphics.DrawImage(&bitmap, 950, 200, nWidth, nHeight);
Create the bitmap on the heap
auto bitmap = std::make_unique<Gdiplus::Bitmap>(L"images.png");
nWidth = bitmap->GetWidth();
nHeight = bitmap->GetHeight();
graphics.DrawImage(bitmap.get(), 950, 200, nWidth, nHeight);
bitmap
is an object (and not a pointer) of type std::unique_ptr<Gdiplus::Bitmap>
. During destruction, the Gdiplus::Bitmap
object it points to will also be destroyed. There is no need to put the unique_ptr
into a container.