- 꼭
- ?
- 게 ?
- ?
>?? ¶
그 , () 그고 그 . 깜 고, .
그 과 게 까? 꼭 깜 거 . (Idle) 간 기 고 게 .
기 고 겠 각 극 기 . 갱 . 갱(Gang) 그 개 겨 경 . 경 깔고 그 .
~cpp #include "resource.h" HBITMAP hBit, hBaby; TCHAR szGang[]="Gang Version 1.0\r\n\r\n 감 : \r\n" "개 : \r\n : \r\n : "; int my; void DrawBitmap(HDC hdc,int x,int y,HBITMAP hBit) { HDC MemDC; HBITMAP OldBitmap; int bx,by; BITMAP bit; MemDC=CreateCompatibleDC(hdc); OldBitmap=(HBITMAP)SelectObject(MemDC, hBit); GetObject(hBit,sizeof(BITMAP),&bit); bx=bit.bmWidth; by=bit.bmHeight; BitBlt(hdc,0,0,bx,by,MemDC,0,0,SRCCOPY); SelectObject(MemDC,OldBitmap); DeleteDC(MemDC); } void OnTimer() { RECT crt; HDC hdc,hMemDC; HBITMAP OldBit; HFONT font, oldfont; RECT grt; int i,j; GetClientRect(hWndMain,&crt); hdc=GetDC(hWndMain); if (hBit==NULL) { hBit=CreateCompatibleBitmap(hdc,crt.right,crt.bottom); } hMemDC=CreateCompatibleDC(hdc); OldBit=(HBITMAP)SelectObject(hMemDC,hBit); DrawBitmap(hMemDC,0,0,hBaby); SetBkMode(hMemDC,TRANSPARENT); font=CreateFont(30,0,0,0,0,0,0,0,HANGEUL_CHARSET,3,2,1, VARIABLE_PITCH | FF_ROMAN,"궁"); oldfont=(HFONT)SelectObject(hMemDC,font); my--; if (my==20) { KillTimer(hWndMain,1); } SetTextColor(hMemDC,RGB(192,192,192)); for (i=-1;i<=1;i++) { for (j=-1;j<=1;j++) { SetRect(&grt,10+i,my+j,400+i,my+300+j); DrawText(hMemDC,szGang,-1,&grt,DT_WORDBREAK); } } SetTextColor(hMemDC,RGB(32,32,32)); SetRect(&grt,10,my,400,my+300); DrawText(hMemDC,szGang,-1,&grt,DT_WORDBREAK); SelectObject(hMemDC,oldfont); DeleteObject(font); SelectObject(hMemDC,OldBit); DeleteDC(hMemDC); ReleaseDC(hWndMain,hdc); InvalidateRect(hWndMain,NULL,FALSE); } LRESULT CALLBACK WndProc(HWND hWnd,UINT iMessage,WPARAM wParam,LPARAM lParam) { HDC hdc,hMemDC; PAINTSTRUCT ps; HBITMAP OldBit; RECT crt; switch(iMessage) { case WM_CREATE: hBaby=LoadBitmap(g_hInst,MAKEINTRESOURCE(IDB_BITMAP1)); case WM_LBUTTONDOWN: SetTimer(hWnd,1,70,NULL); my=310; return 0; case WM_TIMER: OnTimer(); return 0; case WM_PAINT: hdc=BeginPaint(hWnd, &ps); GetClientRect(hWnd,&crt); hMemDC=CreateCompatibleDC(hdc); OldBit=(HBITMAP)SelectObject(hMemDC, hBit); BitBlt(hdc,0,0,crt.right,crt.bottom,hMemDC,0,0,SRCCOPY); SelectObject(hMemDC, OldBit); DeleteDC(hMemDC); EndPaint(hWnd, &ps); return 0; case WM_DESTROY: if (hBit) { DeleteObject(hBit); } DeleteObject(hBaby); PostQuitMessage(0); KillTimer(hWnd,1); return 0; } return(DefWindowProc(hWnd,iMessage,wParam,lParam)); }
![]() |
![]() |
![]() |
고 . 간 거 Fade In, Fade Out 과 . 기 깔게 구 기 .
~cpp public: CBitmap MemBitmap; CDC MemDC; CPoint Position;
~cpp CTestView::CTestView() { // TODO: add construction code here Position = CPoint(0, 0); }
~cpp void CTestView::OnDraw(CDC* pDC) { CTestDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); MemDC.FillSolidRect(0, 0, 1024, 768, RGB(255, 255, 255)); MemDC.SelectStockObject(NULL_BRUSH); for(int i = 5 ; i <= 10 ; i++) { MemDC.Ellipse(Position.x - i, Position.y - i, Position.x + i, Position.y + i); MemDC.Rectangle(Position.x + 10 - i, Position.y + 10 - i, Position.x + 10 + i, Position.y + 10 + i); } //pDC->StretchBlt(0, 0, 102, 77, &MemDC, 0, 0, 1024, 768, SRCCOPY); pDC->BitBlt(0, 0, 1024, 768, &MemDC, 0, 0, SRCCOPY); // TODO: add draw code for native data here }
~cpp int CTestView::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CView::OnCreate(lpCreateStruct) == -1) return -1; CDC *pDC = GetDC(); MemDC.CreateCompatibleDC(pDC); MemBitmap.CreateCompatibleBitmap(pDC, 1024, 768); MemDC.SelectObject(&MemBitmap); ReleaseDC(pDC); SetTimer(1, 1000, NULL); // TODO: Add your specialized creation code here return 0; } void CTestView::OnTimer(UINT nIDEvent) { // TODO: Add your message handler code here and/or call default Invalidate(); Position.x += 2; Position.y += 1; CView::OnTimer(nIDEvent); }