15,898,939 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by neyerMat (Top 6 by date)
neyerMat
5-Dec-13 11:02am
View
Reason for my vote of 5 \n thanks for sharing
neyerMat
20-Jun-12 9:16am
View
another great article how to create metafiles:
http://www.codeproject.com/Articles/177394/Working-with-Metafile-Images-in-Net#_rating
That's more or less exactly what we do in our programm, but with C++. That make things a lot easier. You can create UserControls which can render on any System.Drawing.Graphics device.
asfaik and also regarding to the solutions provided, nothing similar exists for WPF.
neyerMat
14-Jun-12 6:48am
View
http://social.msdn.microsoft.com/Forums/zh/wpf/thread/803b1f4b-5a70-4fa7-9f1a-d4d84aeb5deb
This gives more information about the effort to export SVG... any tipps for another format??
neyerMat
13-Jun-12 4:33am
View
http://answers.microsoft.com/en-us/office/forum/office_2010-word/svg-does-not-paste-properly-into-word/b24a9fc2-1093-49bd-ad9e-6f7585e8934a
just to let you know how "good" SVG works together with MS-Office.
Another point of view is that Microsoft itself do exactly the same for PostScript Printers.
http://msdn.microsoft.com/de-de/library/ms742418.aspx
BUT it's just not possible to use that already implemented feature...
http://social.msdn.microsoft.com/Forums/en-US/windowsxps/thread/dab2607b-1119-41d6-bf1d-6df02cbd4951
It's getting more and more frustrating. It seems that there is NO SOLUTION to create a vector graphic from WPF. WMF/EMF is dead (but still in use...), SVG is not supported by Microsoft (big A vs. big M???) XPS is not supported by anyone except MS.
At the moment the only solution seems to generate EPS files with a virtual printer or JUST FORGET WPF!
For me it looks like Microsoft want to push their own standards (XAML, XPS) and just don't support other formats to make the new file-formats popular...
neyerMat
12-Jun-12 4:24am
View
Thank you for your answers(s)
I don't want to mix up the technologies. I just want to figure out which one is the right to develop my application. As already mentioned above the current software is written in Visual C++. It works fine but it's getting harder day by day to maintain this "piece" of code (~300 000 lines).
Now we want to redesing the whole program. I already made several sample applications in WinForms and WPF to analyze which technology is the right one.
For WPF there are a lot of possibilites as you already suggested. the following article discribe a very good solution how to get things done in WPF.
http://www.codeproject.com/Articles/24681/WPF-Diagram-Designer-Part-4
Our application is a little bit mor complex. Instead of single shapes we would have complex UIElements such as Charts, TextBoxes, Images, etc. The software is like a report generator but the user can design the layout at runtime.
That's still a lot of work, but no big deal if you have only to get the results on screen and print them.
But we have to export the outputs as EMF (or any other accurate format) to import it at least to MS-Office.
afaik WPF does NOT bring this functionallity out of the box. So the way we would have to go in WPF is write each UIElement on our own with basic Shape objects. Than write a Export method which "translate" the WPF shapes to the desired file format.
As WPF already works with vectors for me it seems to reinvent the wheel (I know that WPF is more than just 2D-charting and the fileFormats such as EMF or SVG are not capable of all the possibilties that WPF has)
But with this restrictions WPF seems not to be the best choice, even if it has Zoom and Pan,etc. already implemented(also MFC(GDI+) can do that more or less out of the box).
To bring it to the point:
How to design the UIElements (charts, text, images, mix of both) to export it as EMF or similar?
The way above seems to be the only solution but with a huge effort (Write EMF or SVG export from scratch). Any other ideas???
[edit]
In fact EMF just stores a stack of GDI commands. Maybe it's not the correct format when using WPF. Anyway.. is there any file format which should do the job for WPF?? How do others export their results? Screenshots? :-\ XPS? Workarounds with virtual PDF or GhostScript Printers???
neyerMat
11-Jun-12 8:19am
View
Thank you for your respone.
This is a quite good idea. I already thougt about that. I also thougt about EMF/WMF to generate the diagrams and render it to Bitmap or a WPF Visual for UI. But there are many problems with that solution:
- As you already mentioned, it's very tricky to have user interaction with this graphics.
- afaik SVG is rearlly supported by Microsoft (especially Office).
- "3rd party controls" can not be used because no WPF Visual supports "DrawToSVG" or similar. That would mean that Controls such as Graphs, Button or even a TextBox can not be exported. I would have to reinvent the wheel and code every standard Control again (or at least derive from thoose) to support SVG.
This is the main problem. WPF itself works with vectors, it is not possible to save this vector graphics to a common file format (such as SVG, EMF). I know that is possible to render a Visual to Bitmap. But that's not a vector graphic. SVG seems nice but I don't know how to get it from UIElement.
see:
http://msdn.microsoft.com/en-us/library/system.windows.media.drawingvisual.aspx
Show More