PC Review


Reply
Thread Tools Rate Thread

Convert wmf to jpeg causes black background in result image.

 
 
Jonas
Guest
Posts: n/a
 
      12th Aug 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
 
      12th Aug 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:(E-Mail Removed)...
> 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
Rate This Thread
Rate This Thread:

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 On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
When saving a jpeg in ppt, it saves with a black background, why? Theresa L. Microsoft Powerpoint 1 27th May 2009 08:23 PM
'Save as Picture' leaves a black background when saving as jpeg Vlad Microsoft Powerpoint 3 21st Oct 2008 02:16 PM
how to convert doc w/background color to jpg, jpeg,gif or png =?Utf-8?B?SklNQw==?= Microsoft Word Document Management 2 5th Nov 2007 01:08 PM
convert jpeg file to jpeg image =?Utf-8?B?U291bHJoeWRlcg==?= Windows XP Photos 0 3rd Mar 2007 06:50 PM
Image - convert color image to black and white programmatically DanS Microsoft Dot NET 2 29th Aug 2003 02:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:25 AM.