30 using System.Drawing.Imaging;
32 using OpenSim.Region.Framework.Interfaces;
38 #region ITerrainLoader Members
40 public string FileExtension
42 get {
return ".jpg"; }
47 throw new NotImplementedException();
52 throw new NotImplementedException();
57 throw new NotImplementedException();
62 Bitmap colours = CreateBitmapFromMap(map);
64 colours.Save(filename, ImageFormat.Jpeg);
74 Bitmap colours = CreateBitmapFromMap(map);
76 colours.Save(stream, ImageFormat.Jpeg);
80 int offsetX,
int offsetY,
81 int fileWidth,
int fileHeight,
82 int regionSizeX,
int regionSizeY)
84 throw new System.Exception(
"Not Implemented");
106 using (Bitmap gradientmapLd =
new Bitmap(
"defaultstripe.png"))
108 pallete = gradientmapLd.Height;
111 colours =
new Color[pallete];
113 for (
int i = 0; i < pallete; i++)
115 colours[i] = gradientmapLd.GetPixel(0, i);
119 for (
int y = 0; y < map.Height; y++)
121 for (
int x = 0; x < map.Width; x++)
124 int colorindex = (int) (Math.Max(Math.Min(1.0, map[x, y] / 512.0), 0.0) * (pallete - 1));
125 bmp.SetPixel(x, map.Height - y - 1, colours[colorindex]);
ITerrainChannel LoadStream(Stream stream)
void SaveFile(string filename, ITerrainChannel map)
void SaveStream(Stream stream, ITerrainChannel map)
Exports a stream using a System.Drawing exporter.
override string ToString()
virtual void SaveFile(ITerrainChannel m_channel, string filename, int offsetX, int offsetY, int fileWidth, int fileHeight, int regionSizeX, int regionSizeY)
Save a number of map tiles to a single big image file.
ITerrainChannel LoadFile(string filename, int x, int y, int fileWidth, int fileHeight, int w, int h)
ITerrainChannel LoadFile(string filename)