Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to load EPS files and draw them using WinForms

Is it possible to load and display EPS file using plain WinForms GDI+? If not, is there a free library to help out?

I seem to remember that Windows GDI supported EPS files, but after Googling around a bit, I am starting to doubt that memory.

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

I am aware that I can just use any program to convert the file to PNG or something and render it that way, but because I am trying to render at multiple resolutions, I would prefer to keep the vector data in the EPS file.

Thanks!

like image 247
Frank Krueger Avatar asked Oct 07 '09 20:10

Frank Krueger


People also ask

How do I open an EPS file without illustrator?

Use the CorelDraw Suite to open EPS files CorelDraw is a graphics suite developed by Corel. This graphic suite consists of various tools such as CorelDraw which is a vector illustrator tool. CorelDraw is a good alternative to Adobe Illustrator if you want to open EPS files.


2 Answers

All the free or open source libraries I know that can convert EPS to other vector or raster format are all based on Ghostscript. You can invoke ghostscript directly, with wrapper provided or alternatively look at imagemagick. It is a very popular library for manipulating image graphics and has been around for a long time. It also internally relies on Ghostscript for handling EPS format. There is a .NET wrapper for it that you can find at http://imagemagick.codeplex.com/. You can read a bit about its background here too http://www.codeproject.com/KB/dotnet/ImageMagick_in_VBNET.aspx. There is also pstoedit that is also based on ghostscript to read EPS and allow export to format like WMF. You will need to the call to pstoedit API using interop in .NET

Besides Ghostscript there are several commercial products that I known of like ImageGear and LeadTools which will let you take EPS to almost any other kind of graphic formats.

like image 102
Fadrian Sudaman Avatar answered Sep 25 '22 18:09

Fadrian Sudaman


You can use GhostScript to produce images from an EPS. Once you have an image you can then display that within your application.

like image 27
Mark Redman Avatar answered Sep 24 '22 18:09

Mark Redman