HBITMAP issue.
HBITMAP issue.
(OP)
Im writing an sprite class and I have ran into a problem.
In the red bold is my problem. I need to copy the bitmap that HBITMAP points to to another HBITMAP. I tried to simply dereference both hBitmaps so that it would copy the bitmap, and it compiles, but I get a runtime issue that just kicks me out when it reaches that line.
Does the winAPI have a function or something for copying a bitmap that an hbitmap points to into another hbitmap?
Thanks
CODE
CopiedSprite.sImage->SpritePos.x = (SelectedSprite.sImage->SpritePos.x + 20);
CopiedSprite.sImage->SpritePos.y = (SelectedSprite.sImage->SpritePos.y + 20);
*CopiedSprite.sImage->hBitmap = *SelectedSprite.sImage->hBitmap;
::GetObject(CopiedSprite.sImage->hBitmap, sizeof (BITMAP), &CopiedSprite.sImage->Bitmap);
CopiedSprite.sImage->hBitmap = SelectedSprite.sImage->hBitmap;
mImageRepository.push_back(CopiedSprite.sImage);
CopiedSprite.sImage->SpritePos.y = (SelectedSprite.sImage->SpritePos.y + 20);
*CopiedSprite.sImage->hBitmap = *SelectedSprite.sImage->hBitmap;
::GetObject(CopiedSprite.sImage->hBitmap, sizeof (BITMAP), &CopiedSprite.sImage->Bitmap);
CopiedSprite.sImage->hBitmap = SelectedSprite.sImage->hBitmap;
mImageRepository.push_back(CopiedSprite.sImage);
In the red bold is my problem. I need to copy the bitmap that HBITMAP points to to another HBITMAP. I tried to simply dereference both hBitmaps so that it would copy the bitmap, and it compiles, but I get a runtime issue that just kicks me out when it reaches that line.
Does the winAPI have a function or something for copying a bitmap that an hbitmap points to into another hbitmap?
Thanks
RE: HBITMAP issue.
RE: HBITMAP issue.
RE: HBITMAP issue.