![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | 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? |
My System Specs![]() |
| | #2 (permalink) |
| | 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..... |
My System Specs![]() |
| | #3 (permalink) |
| | 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 |
My System Specs![]() |
| | #4 (permalink) |
| | 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 |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| HP7210 doesn't print graphics | Vista print fax & scan | |||
| printer won't print graphics | Vista print fax & scan | |||
| Adding canonical aliases for Compare-Object, Measure-Object, New-Object | PowerShell | |||