Gdi object cpen, Visual Basic Programming

Illustration of GDI object CPen:

1. Generate a SDI application. And name it as gdipen.

2. Press ctrl (control key) and W altogether to invoke the class wizard.

3. Choose the message maps tab into the class wizard.

4. Choose the CGdipenView object id and click the WM_MOUSEMOVE message and then click ok.

5. In response OnMouseMove handler will be inserted in the implementation file gdipenView.cpp as shown below.

6. Now type the coding which is below in the handler.

void CGdipenView::OnMouseMove(UINT nFlags, CPoint point)

{

CPen p(PS_SOLID, 2,

RGB(255,205,255)),pe(PS_DASH,1,RGB(150,200,250));

CClientDC dc(this);

dc.SelectObject(&p);

dc.Rectangle(10,20,50,100);

dc.SelectObject(&pe);

dc.Rectangle(100,20,50,100);

}

7. The PS_SOLID macro in the CPen constructor tells the pen style. The second parameter is the thickness of the pen, namely 2. The third argument indicates the color of the pen. The other pen object is created as pe. Then the 2 Rectangles with the pens p and pe are drawn.

8. Change the thickness, style, and color.

9. Construct the project and execute it to see the impact of the change incorporated.

10. The rectangles would be exhibited when the mouse is moved in the window exhibited.

11. Change the thickness, color, and style of the pen and examine the output after building and executing the project.

Posted Date: 10/10/2012 1:35:03 AM | Location : United States







Related Discussions:- Gdi object cpen, Assignment Help, Ask Question on Gdi object cpen, Get Answer, Expert's Help, Gdi object cpen Discussions

Write discussion on Gdi object cpen
Your posts are moderated
Related Questions
Create a Visual Basic that allows a user to play a variation of Hangman. User Inputs The user types a letter into the textbox.   Functional Items 1. Read a

Events: The Controls are placed on a form and then to make them functional an "event procedure" is related with the control object. An event process is what happens in respons

MULTIPLE DOCUMENT INTERFACE (MDI) WINDOWS   The SDI (Single document interface) supports one open window or document at a particular time. Microsoft's notepad and paint are il

Using Visual Studio 2010 C++ 1) Using Windows Explorer, make a copy of Irvine\examples\Project_sample folder in the folder where you keep your materials for this course.


Creation of the Menu in VB 1. Initiate a new project by choosing a file and then new project. 2. Now select the Standard EXE as the Project type. 3. Build the Form1 activ

Describe different validation controls of VB.net?

Objective: To develop an Application (Excel + VBA) that determines the optimal inventory policy under an All-Units Discount scheme. APPLICATION CHARACTERISTICS Consider the

sir , i need visual basic form design & coding for Reynolds number & type of flow .

Software That Is Obscure: The Software hides the intensions, meaning and actions from the user. For illustration, if a user is asked whether a full installation, the custom in