aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-06-29 19:21:43 +0000
committerJustin Clarke Casey2008-06-29 19:21:43 +0000
commit7d5a21ddbf738c51197a98bef11a52ceb85fe907 (patch)
treeb45ce6542acb9b6d17824983fb8d135560e8d3f8 /OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs
parent* Fix for http://opensimulator.org/mantis/view.php?id=1512 (diff)
downloadopensim-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 '')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs14
1 files changed, 14 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs
index 98d69a5..34bbf78 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/FileLoaders/BMP.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
27using System.Drawing; 28using System.Drawing;
28using System.Drawing.Imaging; 29using System.Drawing.Imaging;
30using System.IO;
29using OpenSim.Region.Environment.Interfaces; 31using OpenSim.Region.Environment.Interfaces;
30 32
31namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders 33namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
@@ -49,6 +51,18 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.FileLoaders
49 51
50 colours.Save(filename, ImageFormat.Bmp); 52 colours.Save(filename, ImageFormat.Bmp);
51 } 53 }
54
55 /// <summary>
56 /// Exports a stream using a System.Drawing exporter.
57 /// </summary>
58 /// <param name="stream">The target stream</param>
59 /// <param name="map">The terrain channel being saved</param>
60 public override void SaveStream(Stream stream, ITerrainChannel map)
61 {
62 Bitmap colours = CreateGrayscaleBitmapFromMap(map);
63
64 colours.Save(stream, ImageFormat.Png);
65 }
52 66
53 /// <summary> 67 /// <summary>
54 /// The human readable version of the file format(s) this loader handles 68 /// The human readable version of the file format(s) this loader handles