I have this bitmap which is a long rectangle. There are 7 different picture going across it. Each "block" has an integer called frame. It starts at 1. When frame increments, that SHOULD change what portion of the bitmap is displayed. Here is my failed attempt at doing this, it should make it more clear as to what I'm trying to do:
the + and - 1 is just to make up for the 1 pixel separater between each portion of the bitmapCode:else if(blocks[i].explode == true) { width = bm.bmWidth; SelectObject(hDCMem, Explosion); width = (width/7)*(blocks[i].frame) - 1; start = width - (width/7) + 1; BitBlt(hDCBuffer, blocks[i].x + blocks[i].width/2, blocks[i].y + blocks[i].height/2, width, height, hDCMem, start, 0, SRCPAINT); blocks[i].frame++; if(blocks[i].frame == 7) { blocks[i].frame = 1; blocks[i].explode = false; } Sleep(1000); }
oh and each time through, width starts as the width of the entire bitmap
oh, and the problem with it is that it just doesn't display the correct portion



LinkBack URL
About LinkBacks


