diff options
author | Sean Dague | 2008-03-13 20:47:36 +0000 |
---|---|---|
committer | Sean Dague | 2008-03-13 20:47:36 +0000 |
commit | 4e588c715db74575ddc4744bdd520cb57171c2ab (patch) | |
tree | e90e25301335c57f8da6fdfc4606f324682a589c /OpenSim/Region/Environment/Modules | |
parent | * Added cautionary README.txt (diff) | |
download | opensim-SC_OLD-4e588c715db74575ddc4744bdd520cb57171c2ab.zip opensim-SC_OLD-4e588c715db74575ddc4744bdd520cb57171c2ab.tar.gz opensim-SC_OLD-4e588c715db74575ddc4744bdd520cb57171c2ab.tar.bz2 opensim-SC_OLD-4e588c715db74575ddc4744bdd520cb57171c2ab.tar.xz |
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.
Diffstat (limited to 'OpenSim/Region/Environment/Modules')
-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++) |