From 4e588c715db74575ddc4744bdd520cb57171c2ab Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 13 Mar 2008 20:47:36 +0000 Subject: some hackery with the VectorRenderModule to let you pass in a canvas size. Helps make the fonts crisp when using vector renderer as a text board. --- OpenSim/Region/Environment/Modules/VectorRenderModule.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Environment') 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 private void Draw(string data, LLUUID id, string extraParams) { - Bitmap bitmap = new Bitmap(256, 256, System.Drawing.Imaging.PixelFormat.Format32bppArgb); + // TODO: this is a brutal hack. extraParams should actually be parsed reasonably. + int size = 256; + try { + size = Convert.ToInt32(extraParams); + } catch (Exception e) { + + } + + if ((size < 128) || (size > 1024)) + size = 256; + + Bitmap bitmap = new Bitmap(size, size, System.Drawing.Imaging.PixelFormat.Format32bppArgb); System.Drawing.Graphics graph = System.Drawing.Graphics.FromImage(bitmap); @@ -69,7 +80,7 @@ namespace OpenSim.Region.Environment.Modules } else { - graph.FillRectangle(new SolidBrush(Color.White), 0, 0, 256, 256); + graph.FillRectangle(new SolidBrush(Color.White), 0, 0, size, size); } for (int w = 0; w < bitmap.Width; w++) -- cgit v1.1