Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

windows GDI

Status
Not open for further replies.

milosd

Programmer
Mar 2, 2000
9
0
0
SI
Can anybody tell me how to get the graphics drivers working in Windows?<br><br>Thanks
 
Could you clairify this a little? ie: Is this a programming question? Any particular version of driver? Any particular method of accessing these drivers that you are have problems with. Etc..... <p> <br><a href=mailto:Kim_Christensen@telus.net>Kim_Christensen@telus.net</a><br><a href= Page</a><br>
 
I'm trying to write a program which uses windows graphich driver interface.How can I get the handle of the driver to which the help file refers to?
 
If you are thinking of Windows GDI function calls, ie API calls, then all you have to do is get the device context of the client area. Select a pen into the device context while preserving the handle of the original pen. Use one of the GDI drawing functions like Ellipse(). Then select the pen out of the device context and delete it. Something like below:<br><br>&nbsp;&nbsp;&nbsp;zhdc = GetDC(hwnd); // Get device context of our Window<br><br>&nbsp;&nbsp;&nbsp;NewPen = CreatePen(PS_SOLID, 6, RGB(255, 0, 0));&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Create a Red pen<br>&nbsp;&nbsp;&nbsp;OldPen = SelectObject(zhdc, NewPen); // Get handle of original pen & set New pen<br>&nbsp;&nbsp;&nbsp;Ellipse(zhdc, 20, 40, 40, 60);<br>&nbsp;&nbsp;&nbsp;SelectObject(zhdc, OldPen);&nbsp;&nbsp;// Put the old pen back so we can<br>&nbsp;&nbsp;&nbsp;DeleteObject(NewPen);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// safely delete the Red one<br><br>&nbsp;&nbsp;&nbsp;ReleaseDC(hwnd, zhdc);<br> <p> <br><a href=mailto:Kim_Christensen@telus.net>Kim_Christensen@telus.net</a><br><a href= Page</a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top