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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Local Device Context

Status
Not open for further replies.

SteveD73

Programmer
Jan 5, 2001
109
GB
Hi

I have created a function with the following prototype:

CDC* GetSquares();

This function needs to create a CDC with is 100 by 100 pixels large. In this CDC the function needs to to draw a single square. Once the sqaure the is drawn the function should return the CDC.

How can I create a CDC 100 by 100 pixels large within this function?

The function returns the CDC to OnDraw and then the CDC is BitBlt directly to the screen.

I have been trying to use CreateCompatibleBitmap() and then selecting this into my CDC. But this does not work.

Any help on this would be great.

Thank you.
 
if ur using the fucntion in ondraw whydont u send the pDC in OnDraw fuction as parameter to GetSquare and then u can directly draw to the DC or u can create a compatible bitmap and return the bitmap and then bitblit it the second is round about way i prefer the first one
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top