How to load EPS files and draw them using WinForms

Is it possible to download and display an EPS file using simple WinForms GDI +? If not, is there a free library to help?

It seems that I remember that Windows GDI supports EPS files, but after Googling a bit, I begin to doubt this memory.

All I want to do is upload the file and draw it using the Graphics context.

I know that I can simply use any program to convert the file to PNG or something else and make it that way, but since I am trying to render with multiple resolutions, I would prefer to save the vector data in an EPS file.

Thanks!

+6
c # graphics eps
source share
3 answers

You can use GhostScript to create images from EPS. Once you have an image, you can display it in your application.

+2
source share

All the free open source libraries that I know that can convert EPS to another vector or raster format are based on Ghostscript. You can invoke ghostscript directly, using the cover, or alternatively look at imagemagick. This is a very popular image graphics management library and has been around for a long time. It also relies on Ghostscript internally to handle the EPS format. There is a .NET shell for it, which you can find at http://imagemagick.codeplex.com/ . You can read a little about his background here http://www.codeproject.com/KB/dotnet/ImageMagick_in_VBNET.aspx . There is also pstoedit, which is also ghostscript-based for reading EPS and allows you to export in WMF format. You will need to access the pstoedit API using interop in .NET.

In addition to Ghostscript, there are several commercial products that I know as ImageGear and LeadTools, which will allow you to use EPS for almost any other graphic format.

+2
source share

In your question, you indicated that you want output in a vector format that would prevent bitmaps, jpeg, etc. Here are some ways to get the XAML file, which is a vector file with wide Microsoft support.

Microsoft Expression Blend 3 and Design 3 can open .ai (eps) files and convert them to vector formats, design and XAML respectively, so this is definitely possible.

I know that automating most Microsoft Office applications, such as Word and Excel, is relatively easy, but I have not seen any documented com-op assemblies for these Expression products.

Perhaps you can use converters that are part of Expression in an undocumented way?

If this does not work, this is plan B:

Here is a free converter that converts .ai (eps) files to XAML. To use it, you need Adobe Illustrator.

+1
source share

All Articles