본문 바로가기
C & C++/MFC Media

GDI+ 설정(셋팅) 하기

by izen8 2014. 8. 14.
반응형

아래는 GDI+를 사용하기위한 셋팅입니다. 먼저 MFC프로젝트를 생성하고

1.stdafx.h에

#include <GdiPlus.h>
#pragma comment(lib, "gdiplus")
using namespace Gdiplus;

2. CxxxxxApp의 header파일에

ULONG_PTR m_gpToken;

3. CxxxxxApp의 Cpp파일에

아래 함수에 내용 추가

 BOOL CxxxxxxApp::InitInstance()

   GdiplusStartupInput gdiplusStartupInput;
   if(GdiplusStartup(&m_gpToken, &gdiplusStartupInput, NULL) != Ok){

      AfxMessageBox(_T("GDI+를 초기화 하는데 실패했습니다."));

    return FALSE;
 }

int CRemoteControlViewApp::ExitInstance()
{
    //TODO: 추가한 추가 리소스를 처리합니다.
    GdiplusShutdown(m_gpToken);
    return CWinAppEx::ExitInstance();
}

 이제 컴파일 하고 사용하시면 됩니다.

반응형

'C & C++ > MFC Media' 카테고리의 다른 글

마우스 커서 포함하여 이미지 캡쳐  (0) 2014.11.10
화면 캡쳐(Screen Capture) 하기  (0) 2013.11.14
BMP 투명화 처리  (0) 2012.11.09
WM_PAINT 메세지에 대하여...  (0) 2012.10.05
picture control 투명화 처리  (0) 2012.08.30

댓글