saving bitmaps confusion

okay, i've been having a little trouble working with bitmaps in c++. i've learned a lot, but i'm still having problems with:
1.) saving the bitmap after i have blit-ed it.
and
2.) working with the bit maps. i.e. parsing through pixels to find a certain rbg value, and then returning the pixel coordinate.

this is what i have so far:



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
int main(){
	int screenWidth = GetSystemMetrics(SM_CXSCREEN);
	int screenHeight = GetSystemMetrics(SM_CYSCREEN);
	HWND subWindow = FindWindow(NULL, TEXT("Facebook - Mozilla Firefox"));
	SetForegroundWindow(subWindow);
	HDC subWindowDC = GetDC(subWindow);

	HDC bitmapMedium = CreateCompatibleDC(subWindowDC);
	HBITMAP captBitmap = CreateCompatibleBitmap(subWindowDC, screenWidth, screenHeight);
	
	SelectObject(bitmapMedium, captBitmap);
	BITMAP myBitmap; 
	GetObject(captBitmap, sizeof(myBitmap), &myBitmap);

	BitBlt(bitmapMedium, 0, 0, myBitmap.bmWidth, myBitmap.bmHeight, subWindowDC, 0, 0, SRCCOPY);

}


i'm not even sure if i'm doing what i've done correctly since i only fully understand about 75% of the code. but i've only been working with c++ for a week so i'll catch on :)

thanks for any help,

jesse

Topic archived. No new replies allowed.