Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Convert wmf to jpeg causes black background in result image.

Reply
Thread Tools

Convert wmf to jpeg causes black background in result image.

 
 
Jonas
Guest
Posts: n/a
 
      08-12-2005
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


 
Reply With Quote
 
 
 
 
Daniel Fisher\(lennybacon\)
Guest
Posts: n/a
 
      08-12-2005
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
>



 
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert jpg image to black and white? Uli Kunkel Java 11 02-20-2009 01:23 PM
Removing Black background on image. Dave Croft Computer Support 7 07-13-2007 06:39 PM
Convert PDF to Image (JPEG) Marco ASP .Net 0 12-08-2003 03:06 AM
How to convert JPEG image into a binary data? Lucas Cowald ASP .Net Mobile 0 10-15-2003 08:52 AM
How to convert JPEG image into a binary data? Lucas Cowald ASP .Net Datagrid Control 0 10-15-2003 08:51 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57