Copy a DC to another DC

Is there a way to copy one Device Context(DC) to another?  The application I am working on is using an old graphics package and does not have a way to print the graphics.  I thought if I can copy the DC from the graphics window to a printer DC I could solve this problem.
Who is Participating?

Improve company productivity with a Business Account.Sign Up

Answers2000Connect With a Mentor Commented:
Thanks traott

Merry Xmas
BitBlt with the SRCCOPY operation
traottAuthor Commented:
Doesn't BitBlt only copy bitmaps to DC.  From what I read it will only copy the raster and not the vector part.  I need both.  I am misunderstanding the use of BitBlt.
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Could you create a new pointer to the original DC?  Or do you need a completely separate DC?
traottAuthor Commented:
I believe I need a completely seperate DC, because to print, you have to create a Printer Device Context instead of a screen Device Context.  This way I can send the Printer DC to the Draw function of the Graphics package with basically the same info except I am sending it to the printer instead of the screen.
The DC represents the interface to a drawing surface

It doesn't actually store anything (except status stuff like what pen color, etc)

The data on the DC is rendered...and for Windows video drivers...will always be rendered as a bitmap - i.e. there is no vector data associated with the content of the screen - as soon as you draw something (e.g. a line) the video driver converts it to a bitmap.

So BitBlt is the way..

BTW the only except to the rendering rule is meta-files which do actually (kind of) store vectors.  But this doesn't apply in your case, as you are working with a screen image.
traottAuthor Commented:
Thanks for the clarification on what is actually drawn on the screen, this will help.  I will give Answers2000 the points if you add in the answer
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.