1 / 17

MFC 를 이용한 그림판 제작 .

MFC 를 이용한 그림판 제작. 발표일 : 2013. 04. 17 발표자 : 12’ 김지은. 대목차. 직선 , 사각형 , 원 , 둥근 사각형 그리기 , 전체 지우기 3~10p 부분 지우기 , 화면복원 , Menu Interface 11~16p. 목 차. MFC 직선그리기 사각형 그리기 원 그리기 둥근사각형 그리기 색상자. MFC 란. Microsoft foundation class 의 약어

mckile
Download Presentation

MFC 를 이용한 그림판 제작 .

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MFC를 이용한 그림판 제작. 발표일 : 2013. 04. 17 발표자 : 12’ 김지은

  2. 대목차 • 직선, 사각형, 원, 둥근 사각형 그리기, 전체 지우기3~10p • 부분 지우기, 화면복원, Menu Interface 11~16p

  3. 목차 • MFC • 직선그리기 • 사각형 그리기 • 원 그리기 • 둥근사각형 그리기 • 색상자

  4. MFC란 • Microsoft foundation class의 약어 • 마이크로 소프트사의 윈도 응용 프로그램 개발용 클레스 라이브러리 • Visual C++에 포함되어 있고, Win32 프로그래밍에 사용됨

  5. 직선 그리기 Moveto(m_point.x, m_point.y) Lineto(m_point2.x, m_point2.y)

  6. 사각형 그리기 • Rectangle(시작점x, 시작점y, 끝점x, 끝점y ) 시작점 (m_point.x, m_point.y) 끝점 (m_point2.x, m_point2.y)

  7. 원 그리기 • Ellipse (시작점x, 시작점y, 끝점x, 끝점y ) 시작점 (m_point.x, m_point.y) 끝점 (m_point2.x, m_point2.y)

  8. 둥근 사각형 그리기 • RoundRect (시작점x, 시작점y, 끝점x, 끝점y ,둥근정도a, b) 시작점 (m_point.x, m_point.y) 모서리의 둥근정도 (a, b) 끝점 (m_point2.x, m_point2.y)

  9. 색상자 만들기

  10. 전체 지우기 • MFC 에서 화면을 새로 그리겠다는 것을 알려주는 Invalidate() 함수의 인자로 들어가는 true 와 false 에 따라 결과값이 달라짐 • true 일 때는 배경을 지우고 그리고 false 일 때는 그냥 현재 배경 위에서 그린다. • Invalidate(TRUE) : 실행 초기화 • Invalidate(FALSE) : 현재 그려져 있는 것을 지우지 않는다

  11. 목차 • 부분 지우기 • 화면복원 (1/2) • 화면복원 (2/2) • Menu Interface (1/2) • Menu Interface (2/2)

  12. 부분 지우기 Class wizard 에서 OnRectRemove함수를 만들어준 뒤 select =5 로지정 • void CDrawKimgeunView::OnLButtonUp(UINT nFlags, CPoint point) ( 선의종류, 굵기, RGB값 ) (안에 채워질 RGB값)

  13. 화면 복원 (1/2) 선 좌표점의 시작점과 끝점을 저장하기 위해 m_Start[], m_End[] 생성 DrawLine함수에 시작점과 끝점을 배열로 지정

  14. 화면 복원 (2/2) OnLine함수를 View에 생성한뒤 Select 1로 지정. • void CDrawKimgeunView::OnLButtonDown(UINT nFlags, CPoint point) • void CDrawKimgeunView::OnLButtonUp(UINT nFlags, CPoint point)

  15. Menu Interface (1/2) View -> ClassWizard를 선택하거나, [ ctrl + W ] 버튼을 누르면 클래스 위자드가나타남 Class name에서 View를 선택 Object ID에서 RectRemove선택 Message 에서 COMMAND 선택 => View 클래스에 RectRemove함수가 만들어짐

  16. Menu Interface (2/2) ResourceView 선택 Menu-> IDR_MAINFRAME ID에 사용할 함수선택 Caption에 보여지게 될 이름지정

  17. 참고문헌 • 김용성 저 “Visual C++ 6 완벽가이드 2nd Edition. ” , 영진닷컴

More Related