Код: Выделить всё
Bitmap *pbitmap = new Bitmap(L"images.png");
nWidth = pbitmap->GetWidth();
nHeight = pbitmap->GetHeight();
graphics.DrawImage(pbitmap, 950, 200, nWidth, nHeight);
Код: Выделить всё
// create empty vector container
std::vector my_vec;
// instantiate one Bitmap object
my_vec.push_back(std::make_unique(L"images.png"));
nWidth = my_vec[0]->GetWidth();
nHeight = my_vec[0]->GetHeight();
Bitmap *pbitmap = (Bitmap *) my_vec[0];
graphics.DrawImage(pbitmap, 950, 200, nWidth, nHeight);
Код: Выделить всё
example1.cpp:143:22: error: invalid cast from type '__gnu_cxx::__alloc_traits::value_type' {aka 'std::unique_ptr'} to type 'Gdiplus::Bitmap*'
143 | Bitmap *pbitmap = (Bitmap *) my_vec[0];
Совета?
Подробнее здесь: https://stackoverflow.com/questions/796 ... -a-pointer
Мобильная версия