diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs index 5d4d0f5..a3b53be 100644 --- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs | |||
@@ -355,30 +355,22 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender | |||
355 | lock (this) | 355 | lock (this) |
356 | { | 356 | { |
357 | if (alpha == 256) | 357 | if (alpha == 256) |
358 | bitmap = new Bitmap(width, height, PixelFormat.Format32bppRgb); | ||
359 | else | ||
360 | bitmap = new Bitmap(width, height, PixelFormat.Format32bppArgb); | ||
361 | |||
362 | graph = Graphics.FromImage(bitmap); | ||
363 | |||
364 | // this is really just to save people filling the | ||
365 | // background color in their scripts, only do when fully opaque | ||
366 | if (alpha >= 255) | ||
367 | { | 358 | { |
359 | bitmap = new Bitmap(width, height, PixelFormat.Format32bppRgb); | ||
360 | graph = Graphics.FromImage(bitmap); | ||
368 | using (SolidBrush bgFillBrush = new SolidBrush(bgColor)) | 361 | using (SolidBrush bgFillBrush = new SolidBrush(bgColor)) |
369 | { | 362 | { |
370 | graph.FillRectangle(bgFillBrush, 0, 0, width, height); | 363 | graph.FillRectangle(bgFillBrush, 0, 0, width, height); |
371 | } | 364 | } |
372 | } | 365 | } |
373 | 366 | else | |
374 | for (int w = 0; w < bitmap.Width; w++) | ||
375 | { | 367 | { |
376 | if (alpha <= 255) | 368 | bitmap = new Bitmap(width, height, PixelFormat.Format32bppArgb); |
369 | graph = Graphics.FromImage(bitmap); | ||
370 | Color newbg = Color.FromArgb(alpha,bgColor); | ||
371 | using (SolidBrush bgFillBrush = new SolidBrush(newbg)) | ||
377 | { | 372 | { |
378 | for (int h = 0; h < bitmap.Height; h++) | 373 | graph.FillRectangle(bgFillBrush, 0, 0, width, height); |
379 | { | ||
380 | bitmap.SetPixel(w, h, Color.FromArgb(alpha, bitmap.GetPixel(w, h))); | ||
381 | } | ||
382 | } | 374 | } |
383 | } | 375 | } |
384 | 376 | ||