IT Community - Software Programming, Web Development and Technical Support

Convert Image to Stream

This is a discussion on Convert Image to Stream within the C# Programming forums, part of the Software Development category; How to convert an Image or Bitmap to Stream using C#?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C# Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 01-17-2008, 04:43 AM
$enthil $enthil is offline
D-Web Sr.Programmer
 
Join Date: Apr 2007
Posts: 162
$enthil is on a distinguished road
Smile Convert Image to Stream

How to convert an Image or Bitmap to Stream using C#?
__________________
$enthil
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 01-17-2008, 05:09 AM
it.wily it.wily is offline
D-Web Programmer
 
Join Date: Jul 2007
Posts: 89
it.wily is on a distinguished road
Cool Re: Convert Image to Stream

try this code...

Quote:
MemoryStream imagestream = new MemoryStream();
sourceImage.Save(imagestream, ImageFormat.Jpeg);
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-17-2008, 05:47 AM
$enthil $enthil is offline
D-Web Sr.Programmer
 
Join Date: Apr 2007
Posts: 162
$enthil is on a distinguished road
Smile Re: Convert Image to Stream

I tried this code, but i found some error while creating image object in imagemagick...
__________________
$enthil
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-17-2008, 05:48 AM
it.wily it.wily is offline
D-Web Programmer
 
Join Date: Jul 2007
Posts: 89
it.wily is on a distinguished road
Cool Re: Convert Image to Stream

Can you figure out the error you are facing?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-17-2008, 05:49 AM
$enthil $enthil is offline
D-Web Sr.Programmer
 
Join Date: Apr 2007
Posts: 162
$enthil is on a distinguished road
Smile Re: Convert Image to Stream

i got the following error

Quote:
no pixels defined in cache
__________________
$enthil
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 01-17-2008, 05:51 AM
it.wily it.wily is offline
D-Web Programmer
 
Join Date: Jul 2007
Posts: 89
it.wily is on a distinguished road
Cool Re: Convert Image to Stream

Have you tried some other methods to convert image to stream?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 01-17-2008, 05:55 AM
$enthil $enthil is offline
D-Web Sr.Programmer
 
Join Date: Apr 2007
Posts: 162
$enthil is on a distinguished road
Smile Re: Convert Image to Stream

yes i tried like this...
Quote:
MemoryStream imagestream = new MemoryStream();
sourceImage.Save(imagestream, ImageFormat.Jpeg);
byte[] imgbyte = imagestream.ToArray();
Stream str = new MemoryStream(imgbyte);
but again am getting the following error

Quote:
no decode delegate for this image format
__________________
$enthil
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 01-18-2008, 11:57 PM
$enthil $enthil is offline
D-Web Sr.Programmer
 
Join Date: Apr 2007
Posts: 162
$enthil is on a distinguished road
Smile Re: Convert Image to Stream

In Imagemagick, while passing image as stream, the error occurs. Instead of doing this, save image in a file and pass the image path.. This is how i solved the problem...
__________________
$enthil
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 01-19-2008, 11:10 PM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Default Re: Convert Image to Stream

i think ...ths one is imagemagick ...bugs....can u try with latest version of imagemagick or older version
__________________
The KINGMAKER
Makes Every Thing Possible

Stuffs (My Blog)
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert image to other image format using CODEC in .NET 3.0 Mramesh C# Programming 0 02-07-2008 03:33 AM
How to convert jpg, bmp, tif,... image formats in to another format using c# .Net? Archer C# Programming 1 09-07-2007 08:23 AM
Image Convert into ByteArray using java leoraja8 Java Programming 2 07-16-2007 11:30 PM
Convert Raw Image to JPG or TIFF Balasubramanian.S C# Programming 0 05-24-2007 03:47 AM
Convert Raw Image to JPG or TIFF Balasubramanian.S C# Programming 0 05-24-2007 03:47 AM


All times are GMT -7. The time now is 08:25 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0