From 7d5a21ddbf738c51197a98bef11a52ceb85fe907 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Sun, 29 Jun 2008 19:21:43 +0000
Subject: * Allow terrains to be loaded and saved from streams as well as
directly to and from files * Should be making use of this in the next
revisions
---
.../Modules/World/Terrain/FileLoaders/JPEG.cs | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
(limited to 'OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs')
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs
index 628c201..9886b81 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs
@@ -28,6 +28,7 @@
using System;
using System.Drawing;
using System.Drawing.Imaging;
+using System.IO;
using OpenSim.Region.Environment.Interfaces;
namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
@@ -50,6 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
{
throw new NotImplementedException();
}
+
+ public ITerrainChannel LoadStream(Stream stream)
+ {
+ throw new NotImplementedException();
+ }
public void SaveFile(string filename, ITerrainChannel map)
{
@@ -57,6 +63,18 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
colours.Save(filename, ImageFormat.Jpeg);
}
+
+ ///
+ /// Exports a stream using a System.Drawing exporter.
+ ///
+ /// The target stream
+ /// The terrain channel being saved
+ public void SaveStream(Stream stream, ITerrainChannel map)
+ {
+ Bitmap colours = CreateBitmapFromMap(map);
+
+ colours.Save(stream, ImageFormat.Jpeg);
+ }
#endregion
--
cgit v1.1