---
title: "Bitmap..::.Save Method (Stream, IEncoderOptions)"
canonical: https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Bitmap_Save_2_51cd2989.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# Bitmap.Save Method (Stream, IEncoderOptions)
 
Saves the bitmap into specified [Stream](http://msdn2.microsoft.com/en-us/8f86tw9e).
 
**Namespace:** [Aurigma.GraphicsMill](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```
Public Sub Save ( _stream As Stream, _options As IEncoderOptions _
)
```
 
```csharp
public void Save(Stream stream,IEncoderOptions options
)
```
 
### Parameters
 
 - stream
     - Type: [System.IO.Stream](http://msdn2.microsoft.com/en-us/8f86tw9e)
The target [Stream](http://msdn2.microsoft.com/en-us/8f86tw9e).

 - options
     - Type: [Aurigma.GraphicsMill.Codecs.IEncoderOptions](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_IEncoderOptions.htm.md)
An object containing encoder settings.
 
## Remarks
  
Using this method is the same as creating appropriate writer derived from [FormatWriter](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_FormatWriter.htm.md) and running it in synchronous mode.
 
## Examples
  
```
<%@ Page Language="vb" AutoEventWireup="True"%>
<%@ Import Namespace="Aurigma.GraphicsMill"%>
<%@ Import Namespace="Aurigma.GraphicsMill.Codecs"%>
<%@ Import Namespace="Aurigma.GraphicsMill.Transforms"%>
<script language="vb" runat="server">
'#Region pageload
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)Dim bitmap As New Bitmap(Server.MapPath("SourceImages/Mountain.jpg"))'Resize to 100 pixels widthbitmap.Transforms.Resize(100, 0, InterpolationMode.MediumQuality)
'Save image to response streamResponse.Clear()	bitmap.Save(Response.OutputStream, New JpegEncoderOptions(70, true))Response.End()
End Sub
'#End Region
</script>
```
 
```csharp
<%@ Page Language="c#" AutoEventWireup="True" %>
<%@ Import Namespace="Aurigma.GraphicsMill"%>
<%@ Import Namespace="Aurigma.GraphicsMill.Codecs"%>
<%@ Import Namespace="Aurigma.GraphicsMill.Transforms"%>
<script language="c#" runat="server">
#region pageload
private void Page_Load(object sender, System.EventArgs e)
{Bitmap bitmap = new Bitmap(Server.MapPath(@"SourceImages/Mountain.jpg"));//Resize to 100 pixels widthbitmap.Transforms.Resize(100, 0, InterpolationMode.MediumQuality);
//Save image to response streamResponse.Clear();bitmap.Save(Response.OutputStream, new JpegEncoderOptions(70, true));Response.End();
}
#endregion
</script>
```
   
## See Also

### Reference

- [Bitmap Class](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Bitmap.htm.md)
- [Save Overload](https://www.graphicsmill.com/docs/gm5/O_T_Aurigma_GraphicsMill_Bitmap_Save.htm.md)
- [Aurigma.GraphicsMill Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill.htm.md)
