Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

Render (Print) WPF visual to GDI+ Graphics object

Closed Thread
 
Thread Tools Display Modes
Old 07-05-2007   #1 (permalink)
swythan
Guest


 

Render (Print) WPF visual to GDI+ Graphics object

Hi,

I'm researching how we will go about implementing printed/exported
reports for a possible new product.

We're likely to have some custom data presentation that uses WPF for
rendering, but the reporting frameworks I've been looking at use GDI+
for printing. We will want to render our WPF content into the middle
of their GDI+ graphics context, at as full fidelity as possible.

I guess we could always render the WPF content into a bitmap (at the
printer's resolution) and then render that into the GDI+ context, but
that seems like it's likely to use a lot of memory. Also I would
imagine we'll want to export the reports as PDF, etc as well, so
putting huge bitmaps in the middle could massively increase the file
size.

Any ideas?

James

P.S. Alternatively, does anyone know any reporting frameworks that use
the new XPS APIs for printing?

Old 07-07-2007   #2 (permalink)
Lloyd Dupont
Guest


 

Re: Render (Print) WPF visual to GDI+ Graphics object

No ideas, but that's a good question hey!

On a second thought I have an idea..
based on no experience or knowledge of the API, just an idea to explore....

perhaps you could do the GDI+ printing to an XPS document, then open the XPS
document and render WPF content on it.

Then send this XPS document to the printer.....


Old 07-09-2007   #3 (permalink)
swythan
Guest


 

Re: Render (Print) WPF visual to GDI+ Graphics object

On Jul 7, 1:13 pm, "Lloyd Dupont" <net.galador@ld> wrote:
> perhaps you could do the GDI+ printing to an XPS document, then open the XPS
> document and render WPF content on it.
>
> Then send this XPS document to the printer.....


Ouch. Nice hack! ;-)

Unfortunately, it would rather detract from the usefulness of using a
reporting framework (data-binding, export to HTML/PDF/Excel, etc), as
I'd have to go back through the document inserting content myself.

That makes me think about the export to Word/Excel situation,
actually. Has anyone found a way to render WPF content into a
metafile, or some other vector-based format that Office supports? I
guess that's sort of equivalent to my first question.

James


Old 07-11-2007   #4 (permalink)
Matthias Roth
Guest


 

Re: Render (Print) WPF visual to GDI+ Graphics object

I have the same problem, but no solution so far.
I have found the class CGDIRenderTarget
(Microsoft.Internal.GDIExporter.CGDIRenderTarget), which would do the
job, but it is not accessible.

Matthias
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
HP7210 doesn't print graphics CoreyMiller Vista print fax & scan 2 02-22-2008 07:43 PM
printer won't print graphics kathyz Vista print fax & scan 2 01-20-2008 02:12 PM
Bad 3D render performance of WPF in XP little insect Avalon 3 07-21-2007 06:14 AM
Adding canonical aliases for Compare-Object, Measure-Object, New-Object Alex K. Angelopoulos [MVP] PowerShell 2 05-26-2006 07:58 AM
Render Visuals in ASP.NET Willie Avalon 2 02-10-2006 01:21 AM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50