Printing graphics out of an AXControlSite

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Printing graphics out of an AXControlSite

KlausK-3
All,

I need a kick of how to print a MSChart diagram out of an AXControlSite. I
tried to put the canvas from the AXControlSite into the printerCanvas via
the nonOwnedDC: method.

It produces only white paper...

Has anyone an example like a printable version of the AXControlBrowser?

Cheers,
Klaus


Reply | Threaded
Open this post in threaded view
|

Re: Printing graphics out of an AXControlSite

Christopher J. Demers
"KlausK" <[hidden email]> wrote in message
news:[hidden email]...
> I need a kick of how to print a MSChart diagram out of an AXControlSite. I
> tried to put the canvas from the AXControlSite into the printerCanvas via
> the nonOwnedDC: method.
...

Take a look at this article, it may help you:
http://www.codeproject.com/com/WirgerPrintArticle.asp

The code bellow is _not_ really a good way to do this.  There are some
interesting nuances to it.  For some reason if there are any Dolphin windows
over the canvas being copied they will be included and if there are
non-Dolphin windows over it then there will be white space overlaid.  This
seems contrary to the advertised default behavior of the API.  Can anyone
explain this?  These issues are enough to render this a rather kuldgey
approach.  The code bellow renders to a bitmap, you could adapt it to write
to a PrinterCanvas.  A technique from the above article would probably be
much better than this.

==========
up := URLPresenter showOn: 'http://www.google.com'.
"Wait for IE to load the site, then evaluate the lines bellow, and paste
into Paint."
up setFocus.
viewCanvas := up view canvas.
bitmap := Bitmap compatible: viewCanvas extent: up view extent.
bitmapCanvas := bitmap canvas.
bitmapCanvas backcolor: Color white.
bitmapCanvas erase.
bitmapCanvas bitBlt: viewCanvas rectangle: viewCanvas clipBox to: 0@0 rop:
13369376 "SRCCOPY".
bitmap copyToClipboard.
==========

Chris


Reply | Threaded
Open this post in threaded view
|

Re: Printing graphics out of an AXControlSite

KlausK-3
Chris,

thank you very much. Everything works fine if I am not nosy and have the
debugger in front of my chart. The methods transver only visible parts of
the canvas!

Cheers,
Klaus


Reply | Threaded
Open this post in threaded view
|

Re: Printing graphics out of an AXControlSite

KlausK-3
In reply to this post by Christopher J. Demers
Chris,

thank you very much. Everything works fine if I am not nosy and have the
debugger in front of my chart. The methods transver only visible parts of
the canvas!

Cheers,
Klaus


Reply | Threaded
Open this post in threaded view
|

Re: Printing graphics out of an AXControlSite

Christopher J. Demers
In reply to this post by KlausK-3
"KlausK" <[hidden email]> wrote in message
news:[hidden email]...
> Chris,
>
> thank you very much. Everything works fine if I am not nosy and have the
> debugger in front of my chart. The methods transver only visible parts of
> the canvas!

Yep, that's why I don't recommend the code I included. ;)  One of the
techniques in the article is probably a better way to go if you have time to
understand and implement one of them.

Chris