alexx876

Untitled

Dec 7th, 2018
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.80 KB | None | 0 0
  1. //Отрисовка карты
  2. BOOL drawCard(card obj, HWND hDlg, int x, int y) {
  3.     destroyCard(obj, hDlg);
  4.     //Создаем карту
  5.     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);
  6.    
  7.     HBITMAP hBmp;
  8.     //Накладываем изоюражение на карту
  9.     if (obj.act) { 
  10.         hBmp = (HBITMAP)LoadImage(NULL, ("cards/" + to_string(obj.suit) + "/" + to_string(obj.type) + ".bmp").c_str(), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
  11.     } else {
  12.         hBmp = (HBITMAP)LoadImage(NULL, "cards/0.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
  13.     }
  14.     SendMessage(obj.card, STM_SETIMAGE, (WPARAM)IMAGE_BITMAP, (LPARAM)hBmp);
  15.     return 1;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment