Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - Convert wmf to jpeg causes black background in result image.

 
Thread Tools Search this Thread
Old 08-12-2005, 01:49 PM   #1
Default Convert wmf to jpeg causes black background in result image.


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
  Reply With Quote
Old 08-12-2005, 03:20 PM   #2
Daniel Fisher\(lennybacon\)
 
Posts: n/a
Default Re: Convert wmf to jpeg causes black background in result image.
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
>





Daniel Fisher\(lennybacon\)
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

vB 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
image (jpg,bmp,gif, etc.) convert to equivalent binary representation using vb.net? archieSupremo Software 0 09-06-2009 12:20 PM
Newbie on Mac: Menu background, button and image quality issues Danny Boy DVD Video 4 01-03-2006 05:07 PM
Image acquires Criterion Goro DVD Video 2 08-04-2005 02:28 AM
Re: Security+ Course Available in Northern Virginia, Starts March 15 Rowdy Yates A+ Certification 0 03-03-2005 07:08 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

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