How to C#: Imaging
Using Imaging SDK for C#.NET
WinFroms Controls
Image Access and Modify
Save Image to Stream
Overview
  |  
Home ›› XImage.Raster ›› C# Raster: Save Image(s) to Stream

How to C#: Save Image(s) to stream


Overview for How to save image(s) to stream.





Related .net document control helps:
asp.net edit pdf image using c#: ASP.NET PDF Image Edit Control: online insert, edit PDF images in C#
c# asp.net dicom viewer: ASP.NET Dicom Document Viewer Control: view, annotate dicom imaging files online in ASP.NET
asp.net view tiff images: ASP.NET Tiff Viewer: view, annotate multipage Tiff images in ASP.NET MVC, WebForms using C# Control
c# asp.net pdf editor: EdgePDF: ASP.NET PDF Editor Web Control: Online view, annotate, redact, edit, process, convert PDF documents
asp.net edit pdf image using c#: ASP.NET PDF Image Edit Control: online insert, edit PDF images in C#
c# asp.net dicom viewer: ASP.NET Dicom Document Viewer Control: view, annotate dicom imaging files online in ASP.NET
asp.net view tiff images: ASP.NET Tiff Viewer: view, annotate multipage Tiff images in ASP.NET MVC, WebForms using C# Control



Sample C# Code for Convert RasterImage to GIF

 

 

 

 

Sample Code1:

 

You can use SaveToStream() to save a RasterImage object to Stream.

 



WorkRegistry.Reset();
RasterImage img = new  RasterImage(@"input.jpeg");
MemoryStream stream = new MemoryStream();
img.SaveToStream(stream, ImageFormat.PNG);


 

 

Sample Code2:

 

Save RasterImage to Stream according to the SaveOption.

 



WorkRegistry.Reset();
RasterImage img = new  RasterImage(@"input.jpeg");
SaveOption option = new SaveOption();
option.ImageFormat = ImageFormat.PNG;
MemoryStream ms = new MemoryStream();
img.SaveToStream(ms, option);