Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Отрисовка карты
- BOOL drawCard(card obj, HWND hDlg, int x, int y) {
- destroyCard(obj, hDlg);
- //Создаем карту
- obj.card = CreateWindow("static", ("card" + to_string(obj.id)).c_str(), WS_CLIPSIBLINGS | SS_BITMAP | WS_CHILD | WS_VISIBLE | WS_TABSTOP | SS_NOTIFY, x, y, 10, 10, hDlg, NULL, (HINSTANCE)GetWindowLong(hDlg, GWL_HINSTANCE), NULL);
- HBITMAP hBmp;
- //Накладываем изоюражение на карту
- if (obj.act) {
- hBmp = (HBITMAP)LoadImage(NULL, ("cards/" + to_string(obj.suit) + "/" + to_string(obj.type) + ".bmp").c_str(), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
- } else {
- hBmp = (HBITMAP)LoadImage(NULL, "cards/0.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
- }
- SendMessage(obj.card, STM_SETIMAGE, (WPARAM)IMAGE_BITMAP, (LPARAM)hBmp);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment