diff options
author | Justin Clarke Casey | 2008-06-29 19:21:43 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-06-29 19:21:43 +0000 |
commit | 7d5a21ddbf738c51197a98bef11a52ceb85fe907 (patch) | |
tree | b45ce6542acb9b6d17824983fb8d135560e8d3f8 /OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs | |
parent | * Fix for http://opensimulator.org/mantis/view.php?id=1512 (diff) | |
download | opensim-SC_OLD-7d5a21ddbf738c51197a98bef11a52ceb85fe907.zip opensim-SC_OLD-7d5a21ddbf738c51197a98bef11a52ceb85fe907.tar.gz opensim-SC_OLD-7d5a21ddbf738c51197a98bef11a52ceb85fe907.tar.bz2 opensim-SC_OLD-7d5a21ddbf738c51197a98bef11a52ceb85fe907.tar.xz |
* 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
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs index 9bfe851..0cd9000 100644 --- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs +++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/GIF.cs | |||
@@ -24,8 +24,10 @@ | |||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | |||
27 | using System.Drawing; | 28 | using System.Drawing; |
28 | using System.Drawing.Imaging; | 29 | using System.Drawing.Imaging; |
30 | using System.IO; | ||
29 | using OpenSim.Region.Environment.Interfaces; | 31 | using OpenSim.Region.Environment.Interfaces; |
30 | 32 | ||
31 | namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | 33 | namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders |
@@ -38,6 +40,18 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
38 | 40 | ||
39 | colours.Save(filename, ImageFormat.Gif); | 41 | colours.Save(filename, ImageFormat.Gif); |
40 | } | 42 | } |
43 | |||
44 | /// <summary> | ||
45 | /// Exports a stream using a System.Drawing exporter. | ||
46 | /// </summary> | ||
47 | /// <param name="stream">The target stream</param> | ||
48 | /// <param name="map">The terrain channel being saved</param> | ||
49 | public override void SaveStream(Stream stream, ITerrainChannel map) | ||
50 | { | ||
51 | Bitmap colours = CreateGrayscaleBitmapFromMap(map); | ||
52 | |||
53 | colours.Save(stream, ImageFormat.Gif); | ||
54 | } | ||
41 | 55 | ||
42 | public override string ToString() | 56 | public override string ToString() |
43 | { | 57 | { |