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/JPEG.cs | |
parent | * Fix for http://opensimulator.org/mantis/view.php?id=1512 (diff) | |
download | opensim-SC-7d5a21ddbf738c51197a98bef11a52ceb85fe907.zip opensim-SC-7d5a21ddbf738c51197a98bef11a52ceb85fe907.tar.gz opensim-SC-7d5a21ddbf738c51197a98bef11a52ceb85fe907.tar.bz2 opensim-SC-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/JPEG.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/JPEG.cs | 18 |
1 files changed, 18 insertions, 0 deletions
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 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Drawing; | 29 | using System.Drawing; |
30 | using System.Drawing.Imaging; | 30 | using System.Drawing.Imaging; |
31 | using System.IO; | ||
31 | using OpenSim.Region.Environment.Interfaces; | 32 | using OpenSim.Region.Environment.Interfaces; |
32 | 33 | ||
33 | namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | 34 | namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders |
@@ -50,6 +51,11 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
50 | { | 51 | { |
51 | throw new NotImplementedException(); | 52 | throw new NotImplementedException(); |
52 | } | 53 | } |
54 | |||
55 | public ITerrainChannel LoadStream(Stream stream) | ||
56 | { | ||
57 | throw new NotImplementedException(); | ||
58 | } | ||
53 | 59 | ||
54 | public void SaveFile(string filename, ITerrainChannel map) | 60 | public void SaveFile(string filename, ITerrainChannel map) |
55 | { | 61 | { |
@@ -57,6 +63,18 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders | |||
57 | 63 | ||
58 | colours.Save(filename, ImageFormat.Jpeg); | 64 | colours.Save(filename, ImageFormat.Jpeg); |
59 | } | 65 | } |
66 | |||
67 | /// <summary> | ||
68 | /// Exports a stream using a System.Drawing exporter. | ||
69 | /// </summary> | ||
70 | /// <param name="stream">The target stream</param> | ||
71 | /// <param name="map">The terrain channel being saved</param> | ||
72 | public void SaveStream(Stream stream, ITerrainChannel map) | ||
73 | { | ||
74 | Bitmap colours = CreateBitmapFromMap(map); | ||
75 | |||
76 | colours.Save(stream, ImageFormat.Jpeg); | ||
77 | } | ||
60 | 78 | ||
61 | #endregion | 79 | #endregion |
62 | 80 | ||