diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Modules/VectorRenderModule.cs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/OpenSim/Region/Environment/Modules/VectorRenderModule.cs b/OpenSim/Region/Environment/Modules/VectorRenderModule.cs index 19bcc88..94257e9 100644 --- a/OpenSim/Region/Environment/Modules/VectorRenderModule.cs +++ b/OpenSim/Region/Environment/Modules/VectorRenderModule.cs | |||
@@ -57,7 +57,18 @@ namespace OpenSim.Region.Environment.Modules | |||
57 | 57 | ||
58 | private void Draw(string data, LLUUID id, string extraParams) | 58 | private void Draw(string data, LLUUID id, string extraParams) |
59 | { | 59 | { |
60 | Bitmap bitmap = new Bitmap(256, 256, System.Drawing.Imaging.PixelFormat.Format32bppArgb); | 60 | // TODO: this is a brutal hack. extraParams should actually be parsed reasonably. |
61 | int size = 256; | ||
62 | try { | ||
63 | size = Convert.ToInt32(extraParams); | ||
64 | } catch (Exception e) { | ||
65 | |||
66 | } | ||
67 | |||
68 | if ((size < 128) || (size > 1024)) | ||
69 | size = 256; | ||
70 | |||
71 | Bitmap bitmap = new Bitmap(size, size, System.Drawing.Imaging.PixelFormat.Format32bppArgb); | ||
61 | 72 | ||
62 | System.Drawing.Graphics graph = System.Drawing.Graphics.FromImage(bitmap); | 73 | System.Drawing.Graphics graph = System.Drawing.Graphics.FromImage(bitmap); |
63 | 74 | ||
@@ -69,7 +80,7 @@ namespace OpenSim.Region.Environment.Modules | |||
69 | } | 80 | } |
70 | else | 81 | else |
71 | { | 82 | { |
72 | graph.FillRectangle(new SolidBrush(Color.White), 0, 0, 256, 256); | 83 | graph.FillRectangle(new SolidBrush(Color.White), 0, 0, size, size); |
73 | } | 84 | } |
74 | 85 | ||
75 | for (int w = 0; w < bitmap.Width; w++) | 86 | for (int w = 0; w < bitmap.Width; w++) |