traott
asked on
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.
BitBlt with the SRCCOPY operation
ASKER
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.
Could you create a new pointer to the original DC? Or do you need a completely separate DC?
ASKER
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.
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.
ASKER
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.