![]() |
|
|
|||||||
![]() |
ASP Net - Convert wmf to jpeg causes black background in result image. |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Hi!
When i use the code below to convert a wmf to a jpg image, the output will always be with a black backgound. ("data" is a byte array containing the WMF file) System.IO.MemoryStream ms = new MemoryStream(data,0,data.Length); ms.Write(data,0,data.Length); ms.Position = 0; System.Drawing.Image img = System.Drawing.Image.FromStream( ms ); this.Response.Clear(); this.Response.ContentType = "image/jpg"; img.Save(this.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg); Does anyone have a solution? /Jonas Jonas |
|
|
|
|
#2 |
|
Posts: n/a
|
Same happens to transparent gifs there is some code that does the job for
gifs maybe it works for your issue too. I wrote an article (but its german): http://www.newtelligence.net/content..._Thumbnail.pdf -- Daniel Fisher(lennybacon) "Jonas" <jonas_nilsson[AT]hotmail.com> wrote in message news:... > Hi! > > When i use the code below to convert a wmf to a jpg image, the output will > always be with a black backgound. > > ("data" is a byte array containing the WMF file) > > System.IO.MemoryStream ms = new MemoryStream(data,0,data.Length); > ms.Write(data,0,data.Length); > ms.Position = 0; > > System.Drawing.Image img = System.Drawing.Image.FromStream( ms ); > > this.Response.Clear(); > this.Response.ContentType = "image/jpg"; > img.Save(this.Response.OutputStream, > System.Drawing.Imaging.ImageFormat.Jpeg); > > Does anyone have a solution? > > /Jonas > |
|