tags:

views:

23

answers:

1

Hi - I was just wondering is that possible to use my existing MFC creadted DC to associate with QPrinter so that it directly uses this existing DC rather creates its own with QPrintDialog??

  • Does Qprinter also does backing store as Qwidget does?I mean does this creates an offscreen image before printing?

Regards, Harris

A: 

First thing: QPrintDialog has nothing to do with your question. You can set-up a QPrinter without using QPrintDialog.

Anyway: You paint into a QPainter where QPrinter is "only" the printing device. Printing only starts when you end the QPainter. So there is a backing store when using QPrinter.

You can't convert a DC to a QPainter so QPrinter can't do anything with a DC. The closest thing would be to get a Bitmap from the DC and print it to a fresh QPainter.

Jens