WinForms.SaveFileDialog dlg = new WinForms.SaveFileDialog();
dlg.Title = "Please
select bitmap file to save";
dlg.Filter = "PNG
Bitmap Files (*.png)|*.png|All files (*)|*";
dlg.CheckPathExists = false;
if( WinForms.DialogResult.OK == dlg.ShowDialog() )
{
int width = 256;
int height = 256;
using( Bitmap bitmap = new Bitmap( width, height ) )
{
BoundBox3d box = stream2.Extents;
Size size = new Size( width, height );
Scaler scaler = new Scaler( box, size );
Graphics graphics = Graphics.FromImage( bitmap );
Pen pen = new Pen( Color.Black );
foreach( LineSegment3d line in stream.Lines )
{
graphics.DrawLine( pen, scaler.Scale( line.StartPoint ),
scaler.Scale(
line.EndPoint ) );
}
bitmap.Save(
dlg.FileName, ImageFormat.Png );
}
}