SaveMemDCToBitmapNoPalete(HDC p_hMemDC,HBITMAP p_hBitmap)
{
 HDC hMemDC = p_hMemDC;
 HBITMAP hBitmap = p_hBitmap;
 int   wBitCount = 32;
 
 BITMAP   Bitmap;  
 BITMAPFILEHEADER   bmfHdr;    
 BITMAPINFOHEADER   bi;
 
 GetObject(hBitmap, sizeof(BITMAP), (LPSTR)&Bitmap); 
 
 bi.biSize = sizeof(BITMAPINFOHEADER);    
 bi.biWidth = Bitmap.bmWidth;    
 bi.biHeight = Bitmap.bmHeight;  
 bi.biPlanes = 1;    
 bi.biBitCount = wBitCount;    
 bi.biCompression = BI_RGB;    
 bi.biSizeImage = 0;  
 bi.biXPelsPerMeter = 0;    
 bi.biYPelsPerMeter = 0;    
 bi.biClrUsed = 0;    
 bi.biClrImportant = 0; 
 
 DWORD dwBmBitsSize = ((Bitmap.bmWidth * wBitCount + 31) / 32) * 4 * Bitmap.bmHeight; 
 
 HANDLE hDib = GlobalAlloc(GHND,dwBmBitsSize+sizeof(BITMAPINFOHEADER)); 
 LPBITMAPINFOHEADER lpbi = (LPBITMAPINFOHEADER)GlobalLock(hDib);    
 *lpbi = bi;
 
 GetDIBits(hMemDC, hBitmap, 0, (UINT)Bitmap.bmHeight,  
  (LPSTR)lpbi + sizeof(BITMAPINFOHEADER), (BITMAPINFO *)lpbi, DIB_RGB_COLORS);    
 
 HANDLE fh = CreateFile("c:\\temp.bmp",GENERIC_WRITE,0,NULL,CREATE_ALWAYS,
  FILE_ATTRIBUTE_NORMAL|FILE_FLAG_SEQUENTIAL_SCAN,NULL);   
 ASSERT(fh != INVALID_HANDLE_VALUE);
 
 DWORD dwDIBSize   =   sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + dwBmBitsSize;
 
 bmfHdr.bfType = 0x4D42;    
 bmfHdr.bfSize = dwDIBSize;  
 bmfHdr.bfReserved1 = 0;    
 bmfHdr.bfReserved2 = 0;    
 bmfHdr.bfOffBits = (DWORD)sizeof(BITMAPFILEHEADER) + (DWORD)sizeof(BITMAPINFOHEADER);    
 
 DWORD dwWritten;
 
 WriteFile(fh,   (LPSTR)&bmfHdr,   sizeof(BITMAPFILEHEADER),   &dwWritten,   NULL);    
 WriteFile(fh, (LPSTR)lpbi, dwDIBSize, &dwWritten, NULL);    
 GlobalUnlock(hDib);    
 GlobalFree(hDib);    
 CloseHandle(fh);
 return TRUE;
}

'MFC > Bitmap' 카테고리의 다른 글

Bitmap.cpp  (0) 2013.08.16
리소스에서 BMP 이미지 불러오기  (0) 2013.08.09
Writing a window image to a BMP file  (0) 2013.08.08
Converting DDB to DIB  (0) 2013.08.08
Bitmap Save  (0) 2013.08.08
Posted by 곰돌이짱
,

Bitmap Save

MFC/Bitmap 2013. 8. 8. 17:50
void CCatchScreenDlg::SaveScreenToFile(LPCTSTR szFileName)
{
	HDC hScrDC = ::GetDC(NULL);
	HDC hMemDC = NULL;

	BYTE *lpBitmapBits = NULL; 

	int nWidth = GetSystemMetrics(SM_CXSCREEN);
	int nHeight = GetSystemMetrics(SM_CYSCREEN); 

	hMemDC = ::CreateCompatibleDC(hScrDC); 

	BITMAPINFO bi; 
	ZeroMemory(&bi, sizeof(BITMAPINFO));
	bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
	bi.bmiHeader.biWidth = nWidth;
	bi.bmiHeader.biHeight = nHeight;
	bi.bmiHeader.biPlanes = 1;
	bi.bmiHeader.biBitCount = 24;

	HBITMAP bitmap = ::CreateDIBSection(hMemDC, &bi, DIB_RGB_COLORS, (LPVOID*)&lpBitmapBits, NULL, 0);
	HGDIOBJ oldbmp = ::SelectObject(hMemDC, bitmap); 

	::BitBlt(hMemDC, 0, 0, nWidth, nHeight, hScrDC, 0, 0, SRCCOPY);

	BITMAPFILEHEADER bh;
	ZeroMemory(&bh, sizeof(BITMAPFILEHEADER));
	bh.bfType = 0x4d42; //bitmap 
	bh.bfOffBits = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER);
	bh.bfSize = bh.bfOffBits + ((nWidth*nHeight)*3);

	CFile file;
	if(file.Open(szFileName, CFile::modeCreate | CFile::modeWrite))
	{ 
		file.Write(&bh, sizeof(BITMAPFILEHEADER));
		file.Write(&(bi.bmiHeader), sizeof(BITMAPINFOHEADER));
		file.Write(lpBitmapBits, 3 * nWidth * nHeight);
		file.Close();
	}

	::SelectObject(hMemDC, oldbmp);
	::DeleteObject(bitmap);
	::DeleteObject(hMemDC);
	::ReleaseDC(NULL, hScrDC);
}

'MFC > Bitmap' 카테고리의 다른 글

Bitmap.cpp  (0) 2013.08.16
리소스에서 BMP 이미지 불러오기  (0) 2013.08.09
Writing a window image to a BMP file  (0) 2013.08.08
Converting DDB to DIB  (0) 2013.08.08
memory dc to bitmap file  (0) 2013.08.08
Posted by 곰돌이짱
,

출판사

도서/출판사 2013. 8. 2. 10:07

21세기북스 -  하버디비즈니스 클래스

http://21cbooks.book21.com/book/search_result.php?topSearchWord=%C7%CF%B9%F6%B5%E5%BA%F1%C1%EE%B4%CF%BD%BA%C5%AC%B7%A1%BD%C4+&x=17&y=11

하버드비즈니스클래식의 구성


이 시리즈는 4개의 분야로 구성되어 있다.

- 전략과 실행 Strategy and Execution

- 리더십과 조직관리 Leadership and Organization

- 마케팅 Marketing

- 글로벌 비즈니스 Global Business


<세부 분류>                                                           * 분류에 변동이 있을 수 있습니다.

                                                                                                     *       1차 발간도서 (10권)

대분류

중분류

소분류

전략과 실행

혁신

 Innovation

 The Innovative Enterprise 혁신 기업의 조건

 

 

 

 Breakthrough Thinking

 

 

 

성장전략

 Strategies for Growth 성장전략

 Measuring Corporate Performance

 

 

 Top-Line Growth 수익 창출의 원리

 

 

 

기업전략

 Corporate Strategy

 Strategic Alliances

 

 

 Managing Uncertainty

 

 

 Knowledge Management

 

 

 

리더십과 조직관리

리더십

 Leadership 리더십

 The Mind of The Leader

 

 

 

 The Persuasive Leader

 

 

 The Tests of a Leader

 

 

 Managing yourself

 

 

 

의사결정

 Decision Making 의사결정의 순간

 Making Smarter Decisions

 

 

 

커뮤니케이션

 Effective Communication

 효과적 커뮤니케이션

 Negotiation and Conflict Resolution

 

 

 

변화관리

 Change 변화관리

 Leading Through Change

 

 

 Culture and Change

 

 

 

인력관리

 Managing People

 Finding & Keeping the Best People

 인재 확보 전략

 

 

 Appraising Employee Performance

 

 

 Motivating People

 

 

 

조직관리

 Teams That Succeed

 High-Performance Organization

 

 

 

마케팅

마케팅 개념

 Marketing 마케팅

 Supply Chain Management

 

 

 

 

 

브랜드

 Brand Management

 

 

 

 

 

 

소비자행동

 Customer Relationship Management

 

 

 

 

 

글로벌 비즈니스

글로벌 리더십

 Leadership in a Changed World  글로벌 리더십

 

 

 

Posted by 곰돌이짱
,