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

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

Infomation system, what are the things that information system can do and t...

what are the things that information system can do and their limitations?

Do loops, You can employ Do...Loop statements to run a block of statements ...

You can employ Do...Loop statements to run a block of statements indefinite number of times. The statements are repeated either whilst a condition is True or till a condition becom

Calculating annual percent yield, I am having a hard time with calculating ...

I am having a hard time with calculating APY in my project. Every time I run the program my second APY is blank.

Application to count the number of possible triangles, A triangle is equila...

A triangle is equilateral if all three sides are equal, isosceles if any two (but no more than two) sides are equal, and scalene if no two sides are equal. A triangle will be input

Resources - visual basic programming, RESOURCES The cursors, Icons, dia...

RESOURCES The cursors, Icons, dialog, bitmaps accelerators, menu, table tool bar and string are the different resources. The resources are compiled by the resource compiler. Th

Project to create splitter window , PROJECT TO CREATE SPLITTER WINDOW   ...

PROJECT TO CREATE SPLITTER WINDOW   1. Generate the SDI application. 2. Enlarge the class tab page. 3. Select the view class. 4. On right clicking the menu pops up.

Vbscript operators, VBScript Operators VBScript contain a full range of...

VBScript Operators VBScript contain a full range of operators, including comparison operators, arithmetic operators, concatenation operators, and logical operators.

Develop a web page for accepting information regarding stock, Develop a web...

Develop a web page that is used for accepting information regarding stocks. Make sure the form carry out the possible validations. The simple instance code below merely illustrates

Assigning values to variables, Assigning Values to Variables Values are...

Assigning Values to Variables Values are assigned to variables creating an expression as follows: the variable is on the left side of the expression & the value you desire to a

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