Gdi object cpen, Visual Basic Programming

Assignment Help:

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.


Related Discussions:- Gdi object cpen

Account Balance, The user has to enter a starting balance, the dollar amoun...

The user has to enter a starting balance, the dollar amount of deposits, and the dollar amount of withdrawals. the program then has to calculate the balance

Shopping cart, Shopping Cart Purpose – Allows user to browse while keeping ...

Shopping Cart Purpose – Allows user to browse while keeping track of the items in which they will purchase at the end on the order page link and this will give a final price for al

Input box - dialogue box in visual basic , Input Box: To demonstrate t...

Input Box: To demonstrate the use of the Input Box as shown in figure. Now consider the illustration shown below: 1. Initiate a new project 2. Select the standard exe

Introduction to database applications , INTRODUCTION TO DATABASE APPLICATIO...

INTRODUCTION TO DATABASE APPLICATIONS   In this section, we define a dialog and tab order that is the order in which the controls will be navigated during the execution. The D

Creation of the menu in visual basic, Creation of the Menu in VB 1. Ini...

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

Using procedure and exception handling, I was looking solution for assignme...

I was looking solution for assignment named Alamo Tour

Simple programming, For this assignment you have to design and implement a ...

For this assignment you have to design and implement a VB.NET project which prepares a bill of payment due, given the purchase amount. The project models a typical purchase transac

Associating images to toolbars - visual basic, Associating Images to Toolba...

Associating Images to Toolbars: 1. Add an Image list to your form from the tool box. 2. Pick the custom property of the image list. 3. Click the images tab. 4. Select

Lotto program, You are asked to create the LOTO game customized according t...

You are asked to create the LOTO game customized according to the following constraints: 1. Create a grid containing 20 numbers (20 buttons: button1, button2, …button20) 2. When t

Architecture of win 32 program, ARCHITECTURE OF WIN 32 PROGRAM   ...

ARCHITECTURE OF WIN 32 PROGRAM   Figure: working of Win 3 program The hardware events in the figure are the mouse associated events like the mouse move, left

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd