diff options
author | Jeff Ames | 2009-04-14 10:00:13 +0000 |
---|---|---|
committer | Jeff Ames | 2009-04-14 10:00:13 +0000 |
commit | fa29cf5c5010f7c3e83494786be1b0c11c663e6d (patch) | |
tree | 51d4cc4d2e82d2a53bb1ca23ef10b3dd63060f0d /OpenSim/Region/OptionalModules/Scripting/Minimodule/Graphics.cs | |
parent | * Adding some organization of vehicle type stuff in the ODEPlugin. (diff) | |
download | opensim-SC_OLD-fa29cf5c5010f7c3e83494786be1b0c11c663e6d.zip opensim-SC_OLD-fa29cf5c5010f7c3e83494786be1b0c11c663e6d.tar.gz opensim-SC_OLD-fa29cf5c5010f7c3e83494786be1b0c11c663e6d.tar.bz2 opensim-SC_OLD-fa29cf5c5010f7c3e83494786be1b0c11c663e6d.tar.xz |
Update svn properties.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/OptionalModules/Scripting/Minimodule/Graphics.cs | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Graphics.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Graphics.cs index 44bae5c..bb4696b 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Graphics.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Graphics.cs | |||
@@ -1,48 +1,48 @@ | |||
1 | using System.Drawing; | 1 | using System.Drawing; |
2 | using OpenMetaverse; | 2 | using OpenMetaverse; |
3 | using OpenMetaverse.Imaging; | 3 | using OpenMetaverse.Imaging; |
4 | using OpenSim.Framework; | 4 | using OpenSim.Framework; |
5 | using OpenSim.Region.Framework.Scenes; | 5 | using OpenSim.Region.Framework.Scenes; |
6 | 6 | ||
7 | namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | 7 | namespace OpenSim.Region.OptionalModules.Scripting.Minimodule |
8 | { | 8 | { |
9 | class Graphics : IGraphics | 9 | class Graphics : IGraphics |
10 | { | 10 | { |
11 | private readonly Scene m_scene; | 11 | private readonly Scene m_scene; |
12 | 12 | ||
13 | public Graphics(Scene m_scene) | 13 | public Graphics(Scene m_scene) |
14 | { | 14 | { |
15 | this.m_scene = m_scene; | 15 | this.m_scene = m_scene; |
16 | } | 16 | } |
17 | 17 | ||
18 | public UUID SaveBitmap(Bitmap data) | 18 | public UUID SaveBitmap(Bitmap data) |
19 | { | 19 | { |
20 | return SaveBitmap(data, false, true); | 20 | return SaveBitmap(data, false, true); |
21 | } | 21 | } |
22 | 22 | ||
23 | public UUID SaveBitmap(Bitmap data, bool lossless, bool temporary) | 23 | public UUID SaveBitmap(Bitmap data, bool lossless, bool temporary) |
24 | { | 24 | { |
25 | AssetBase asset = new AssetBase(); | 25 | AssetBase asset = new AssetBase(); |
26 | asset.FullID = UUID.Random(); | 26 | asset.FullID = UUID.Random(); |
27 | asset.Data = OpenJPEG.EncodeFromImage(data, lossless); | 27 | asset.Data = OpenJPEG.EncodeFromImage(data, lossless); |
28 | asset.Name = "MRMDynamicImage"; | 28 | asset.Name = "MRMDynamicImage"; |
29 | asset.Type = 0; | 29 | asset.Type = 0; |
30 | asset.Description = "MRM Image"; | 30 | asset.Description = "MRM Image"; |
31 | asset.Local = false; | 31 | asset.Local = false; |
32 | asset.Temporary = temporary; | 32 | asset.Temporary = temporary; |
33 | m_scene.CommsManager.AssetCache.AddAsset(asset); | 33 | m_scene.CommsManager.AssetCache.AddAsset(asset); |
34 | 34 | ||
35 | return asset.FullID; | 35 | return asset.FullID; |
36 | } | 36 | } |
37 | 37 | ||
38 | public Bitmap LoadBitmap(UUID assetID) | 38 | public Bitmap LoadBitmap(UUID assetID) |
39 | { | 39 | { |
40 | AssetBase bmp = m_scene.CommsManager.AssetCache.GetAsset(assetID, true); | 40 | AssetBase bmp = m_scene.CommsManager.AssetCache.GetAsset(assetID, true); |
41 | ManagedImage outimg; | 41 | ManagedImage outimg; |
42 | Image img; | 42 | Image img; |
43 | OpenJPEG.DecodeToImage(bmp.Data, out outimg, out img); | 43 | OpenJPEG.DecodeToImage(bmp.Data, out outimg, out img); |
44 | 44 | ||
45 | return new Bitmap(img); | 45 | return new Bitmap(img); |
46 | } | 46 | } |
47 | } | 47 | } |
48 | } | 48 | } |