1 / 8

PRESENTATION

PRESENTATION. Presented to: Ma’am Sadaf Majeed Sial Presented by: M.Amjad Rahim BSIT-08-09 5 th Semester. Program No. 7. Public: Myframe() { Create(0, “Click L Button of Mouse in Client area”); } Void OnLButtonDown(UNIT flag, Cpoint pt) { Startpoint=endpoint=pt;

happy
Download Presentation

PRESENTATION

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. PRESENTATION Presented to: Ma’am Sadaf Majeed Sial Presented by: M.Amjad Rahim BSIT-08-09 5th Semester

  2. Program No. 7 Public: Myframe() { Create(0, “Click L Button of Mouse in Client area”); } Void OnLButtonDown(UNIT flag, Cpoint pt) { Startpoint=endpoint=pt; SetCapture(); } Continue…..

  3. Void On MouseMove (UNIT flag, Cpoint pt) { CClientDC d (this); If(flag==MK_LBUTTON) { d.SetROP2(R2_NOTXORPEN); // erase line d.MoveTo(startpoint); d.LineTo(endpoint); //draw line d.MoveTo(startpoint); d.LineTo(pt); Endpoint=pt; } } Continue…..

  4. Void OnLButtonUp (UNIT flag, CPoint pt){ CClientDC d (this); d.SetROP2(R2_COPYPEN); d.MoveTo (startpoint); d.LineTo (endpoint); ::RealseCapture(); } DECEAR_MESSAGE_MAP() };

  5. Program No.8 Public: Myframe() { Create (0,”Horizental or Vertical \lines”); D=new CClentDc (this); Mypen.createPen(PS_SOLID,1,RGB(255,0,0)); d->SelectObject (&mypen); } Void OnButtonDown (UNIT flag, CPoint pt) { Oldpoint=point1=pt; } Continue…..

  6. Void OnMouseMove (UNIT flag, CPoint pt { If(flags==(MK_LBUTTON | MK_SHIFT)) { If(abs(pt.y-point1.y)>abs(pt.x-point1.x)) Pt.x=pint1.x; Else Pt.y=point1.y; d->SetROP2(R2_NOTXORPEN); d->MoveTo (point1); d->LineTo (oldpoint) d->MoveTo (poin1); d->LineTo (pt); oldpoint=pt; } Continue…..

  7. If(flags==MK_LBUTTON) { d->setROP2(R2_NOTXORPEN); d->MoveTo (point1); d->LineTo (oldpoint); d->MoveTo (point); d->LineTo (pt); oldpoint=pt; } } Continue…..

  8. Viod OnButtonUp (UNIT flags,CPoint pt) { d->SetROP2(R2_COPYPEN); d->MoveTo (point); d->LineTo(oldpoint); } DECLARE_MESSAGE_MAP() };

More Related