1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| hdc = GetDC(hWnd); mdc = CreateCompatibleDC(hdc); bufdc = CreateCompatibleDC(hdc); fullmap = CreateCompatibleBitmap(hdc, WIDTH, HEIGHT); SelectObject(mdc, fullmap);
hBgBmp = (HBITMAP)LoadImage(NULL, "bg.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE); GetObject(hBgBmp, sizeof(BITMAP), &bgBmp);
int i, j; char actionName[10][20] = { "startfly", "fly", "fly2", "attack", "attack2" }; for (i = 0; i < 5; i++) { char fullName[100]; for (j = 0; j < 5; j++) { sprintf(fullName, "%s%d.bmp", actionName[i], j); hRoleBmp[i][j] = (HBITMAP)LoadImage(NULL, fullName, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
sprintf(fullName, "_%s%d.bmp", actionName[i], j); _hRoleBmp[i][j] = (HBITMAP)LoadImage(NULL, fullName, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
GetObject(hRoleBmp[i][j], sizeof(BITMAP), &roleFlyBmp[i][j]); } }
|