• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 235
  • Last Modified:

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.
0
traott
Asked:
traott
  • 3
  • 3
1 Solution
 
Answers2000Commented:
BitBlt with the SRCCOPY operation
0
 
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.
0
 
thresher_sharkCommented:
Could you create a new pointer to the original DC?  Or do you need a completely separate DC?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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.
0
 
Answers2000Commented:
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.
0
 
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
0
 
Answers2000Commented:
Thanks traott

Merry Xmas
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now