C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[71855] Re:c++ api 질문! ㅠ
최진 [blueth] 3253 읽음    2014-10-11 13:53
:    case WM_TIMER:
:             if (ballmovey + ballr>rtClient.bottom - sticky && (stickex<ballx&&ballx<stickex + stickx))
:             {
:                 moveon = 1;
:             }
:             if (ballmovey - ballr<rtClient.top)
:             {
:                 moveon = 0;
:             }
:             if (moveon == 1)
:             {
:                 ballmovey = ballmovey - ballmove;
:             }
:             else if (moveon == 0)
:             {   
:                 ballmovey = ballmovey + ballmove;
:             }
:             InvalidateRect(hWnd, NULL, TRUE);
:             break;
:
    case WM_PAINT:
:         hdc = BeginPaint(hWnd, &ps);
:         // TODO: 여기에 그리기 코드를 추가합니다.
:
:         Rectangle(hdc, stickex, rtClient.bottom - sticky, stickex + stickx, rtClient.bottom); //스틱만들기
:         if(ballmovey > rtClient.bottom)
:         {
:             ballmovey = bally;
:         }
:         Ellipse(hdc, ballx - ballr, ballmovey - ballr, ballx + ballr, ballmovey + ballr); // 공만들기
:
:         //Rectangle(hdc, rt.left, rt.top, rt.right, rt.bottom); //사등분 사각형가장자리 틀
:
:         MoveToEx(hdc, ptcent.x, rt.top, NULL);
:         LineTo(hdc, ptcent.x, rt.bottom);
:
:         MoveToEx(hdc, rt.left, ptcent.y, NULL);
:         LineTo(hdc, rt.right, ptcent.y);
:        
:         EndPaint(hWnd, &ps);
:         break;
:
:     case WM_LBUTTONDOWN:
:         hdc = GetDC(hWnd);
:         if (mx<ptcent.x&&my<ptcent.y&&mx>rt.left&&my>rt.top)
:         {
:             Ellipse(hdc, rt.left, rt.top, ptcent.x, ptcent.y);
:         }
:         else if (mx<ptcent.x&&my>ptcent.y&&my<rt.bottom&&mx>rt.left)
:         {
:             Ellipse(hdc, rt.left, ptcent.y, ptcent.x, rt.bottom);
:         }
:         else if (mx>ptcent.x&&my<ptcent.y&&mx<rt.right&&my>rt.top)
:         {
:             Ellipse(hdc, ptcent.x, rt.top, rt.right, ptcent.y);
:         }
:         else if (mx>ptcent.x&&my>ptcent.y&&my<rt.bottom&&mx<rt.right)
:         {
:             Ellipse(hdc, ptcent.x, ptcent.y, rt.right, rt.bottom);
:         }
:         break;
:
//
WM_LBUTTONDOWN 부분을
WM_TIMER  부분처럼 작성하고 : InvalidateRect(hWnd, NULL, TRUE);     break;

Ellipse(hdc, rt.left, rt.top, ptcent.x, ptcent.y); 를 
WM_PAINT 으로 넣어주세요 ->  if( 1,2,3,4 클릭상태)  Ellipse(hdc, rt.left, rt.top, ptcent.x, ptcent.y);

+ -

관련 글 리스트
71854 c++ api 질문! ㅠ 띵똥 3244 2014/10/10
71855     Re:c++ api 질문! ㅠ 최진 3253 2014/10/11
71857         Re:Re:c++ api 질문! ㅠ 오잉 3105 2014/10/11
71858             Re:Re:Re:c++ api 질문! ㅠ 3296 2014/10/11
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.