Solved

Copy a DC to another DC

Posted on 1998-12-23
7
227 Views
Last Modified: 2013-11-20
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
Comment
Question by:traott
  • 3
  • 3
7 Comments
 
LVL 8

Expert Comment

by:Answers2000
ID: 1326634
BitBlt with the SRCCOPY operation
0
 

Author Comment

by:traott
ID: 1326635
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
 
LVL 6

Expert Comment

by:thresher_shark
ID: 1326636
Could you create a new pointer to the original DC?  Or do you need a completely separate DC?
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Author Comment

by:traott
ID: 1326637
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
 
LVL 8

Expert Comment

by:Answers2000
ID: 1326638
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
 

Author Comment

by:traott
ID: 1326639
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
 
LVL 8

Accepted Solution

by:
Answers2000 earned 100 total points
ID: 1326640
Thanks traott

Merry Xmas
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now