Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Convert EPS to Png using c#

Convert EPS to Png using c#

Scheduled Pinned Locked Moved ASP.NET
graphicshelpcsharpsysadmin
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Imran Khan Pathan
    wrote on last edited by
    #1

    Hi friends. I have a bit problem here. below code generate image from jpg to png but not working with eps.

    protected void Page_Load(object sender, EventArgs e)
    {
    string path = Server.MapPath(Request.QueryString["Path"]);
    byte[] by = FileToArray(path);
    MemoryStream ms = new MemoryStream(by, 0, by.Length);
    ms.Write(by, 0, by.Length);
    System.Drawing.Image img = Bitmap.FromStream(ms);
    // I am getting error in above line when reads eps file
    // Error : Parameter is not valid

    ms.WriteTo(Response.OutputStream);
    }
    public byte[] FileToArray(string sFilePath)
    {
    System.IO.FileStream fs = new System.IO.FileStream(sFilePath,
    System.IO.FileMode.Open, System.IO.FileAccess.Read);
    System.IO.BinaryReader br = new System.IO.BinaryReader(fs);
    Byte[] bytes = br.ReadBytes((Int32)fs.Length);
    br.Close();
    fs.Close();
    return bytes;
    }

    Thanks Regards kHan

    please don't forget to vote on the post that helped you.

    Q 1 Reply Last reply
    0
    • I Imran Khan Pathan

      Hi friends. I have a bit problem here. below code generate image from jpg to png but not working with eps.

      protected void Page_Load(object sender, EventArgs e)
      {
      string path = Server.MapPath(Request.QueryString["Path"]);
      byte[] by = FileToArray(path);
      MemoryStream ms = new MemoryStream(by, 0, by.Length);
      ms.Write(by, 0, by.Length);
      System.Drawing.Image img = Bitmap.FromStream(ms);
      // I am getting error in above line when reads eps file
      // Error : Parameter is not valid

      ms.WriteTo(Response.OutputStream);
      }
      public byte[] FileToArray(string sFilePath)
      {
      System.IO.FileStream fs = new System.IO.FileStream(sFilePath,
      System.IO.FileMode.Open, System.IO.FileAccess.Read);
      System.IO.BinaryReader br = new System.IO.BinaryReader(fs);
      Byte[] bytes = br.ReadBytes((Int32)fs.Length);
      br.Close();
      fs.Close();
      return bytes;
      }

      Thanks Regards kHan

      please don't forget to vote on the post that helped you.

      Q Offline
      Q Offline
      q2006x
      wrote on last edited by
      #2

      Try ImageGlue from Websupergoo.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups