git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@152 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
BIN
libsecondlife-cs/examples/ImageTool/App.ico
Normal file
BIN
libsecondlife-cs/examples/ImageTool/App.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
58
libsecondlife-cs/examples/ImageTool/AssemblyInfo.cs
Normal file
58
libsecondlife-cs/examples/ImageTool/AssemblyInfo.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
//
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
//
|
||||
[assembly: AssemblyTitle("")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("")]
|
||||
[assembly: AssemblyCopyright("")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
//
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
//
|
||||
// In order to sign your assembly you must specify a key to use. Refer to the
|
||||
// Microsoft .NET Framework documentation for more information on assembly signing.
|
||||
//
|
||||
// Use the attributes below to control which key is used for signing.
|
||||
//
|
||||
// Notes:
|
||||
// (*) If no key is specified, the assembly is not signed.
|
||||
// (*) KeyName refers to a key that has been installed in the Crypto Service
|
||||
// Provider (CSP) on your machine. KeyFile refers to a file which contains
|
||||
// a key.
|
||||
// (*) If the KeyFile and the KeyName values are both specified, the
|
||||
// following processing occurs:
|
||||
// (1) If the KeyName can be found in the CSP, that key is used.
|
||||
// (2) If the KeyName does not exist and the KeyFile does exist, the key
|
||||
// in the KeyFile is installed into the CSP and used.
|
||||
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
|
||||
// When specifying the KeyFile, the location of the KeyFile should be
|
||||
// relative to the project output directory which is
|
||||
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
|
||||
// located in the project directory, you would specify the AssemblyKeyFile
|
||||
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
|
||||
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
|
||||
// documentation for more information on this.
|
||||
//
|
||||
[assembly: AssemblyDelaySign(false)]
|
||||
[assembly: AssemblyKeyFile("")]
|
||||
[assembly: AssemblyKeyName("")]
|
||||
109
libsecondlife-cs/examples/ImageTool/ImageTool.cs
Normal file
109
libsecondlife-cs/examples/ImageTool/ImageTool.cs
Normal file
@@ -0,0 +1,109 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
|
||||
using libsecondlife;
|
||||
using libsecondlife.InventorySystem;
|
||||
using libsecondlife.AssetSystem;
|
||||
|
||||
namespace ImageTool
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for Class1.
|
||||
/// </summary>
|
||||
class ImageTool : libsecondlife.InventoryApp
|
||||
{
|
||||
private LLUUID _ImageID;
|
||||
private string _FileName;
|
||||
private bool _Put;
|
||||
|
||||
/// <summary>
|
||||
/// Sample texture for downloading: 0444bf21-f77e-7f63-89e9-b839ec66bc15
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main(string[] args)
|
||||
{
|
||||
if( ImageTools.Check4Tools() == false )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.Length < 5)
|
||||
{
|
||||
Console.WriteLine("Usage: ImageTool [first] [last] [password] [get] [uuid] [(filename)]");
|
||||
Console.WriteLine("Usage: ImageTool [first] [last] [password] [put] [filename]");
|
||||
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Example: ImageTool John Doe Password get 0444bf21-f77e-7f63-89e9-b839ec66bc15 cloud.tif");
|
||||
Console.WriteLine("Example: ImageTool John Doe Password put Sample.tif");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
LLUUID id = null;
|
||||
string filename = "";
|
||||
bool put = false;
|
||||
if( args[3].ToLower().Equals("put") )
|
||||
{
|
||||
put = true;
|
||||
filename = args[4];
|
||||
}
|
||||
else
|
||||
{
|
||||
id = new LLUUID(args[4]);
|
||||
if( args.Length == 6 )
|
||||
{
|
||||
filename = args[5];
|
||||
}
|
||||
else
|
||||
{
|
||||
filename = args[4] + ".tif";
|
||||
}
|
||||
}
|
||||
|
||||
ImageTool it = new ImageTool( id, filename, put );
|
||||
it.Connect(args);
|
||||
it.doStuff();
|
||||
it.Disconnect();
|
||||
|
||||
System.Threading.Thread.Sleep(500);
|
||||
}
|
||||
|
||||
protected ImageTool( LLUUID imageID, string filename, bool put )
|
||||
{
|
||||
_ImageID = imageID;
|
||||
_FileName = filename;
|
||||
_Put = put;
|
||||
}
|
||||
|
||||
protected override void doStuff()
|
||||
{
|
||||
if( _Put )
|
||||
{
|
||||
Console.WriteLine("Reading: " + _FileName);
|
||||
|
||||
byte[] j2cdata = ImageTools.ReadJ2CData( _FileName );
|
||||
|
||||
Console.WriteLine("Connecting to your Texture folder...");
|
||||
InventoryFolder iFolder = AgentInventory.getFolder("Textures");
|
||||
|
||||
Console.WriteLine("Uploading Texture...");
|
||||
iFolder.NewImage( _FileName, "ImageTool Upload", j2cdata );
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Downloading: " + _ImageID);
|
||||
|
||||
ImageManager im = new ImageManager( base.client );
|
||||
byte[] j2cdata = im.RequestImage( _ImageID );
|
||||
|
||||
Console.WriteLine("Writing to: " + _FileName);
|
||||
ImageTools.WriteJ2CAsTiff( _FileName, j2cdata );
|
||||
}
|
||||
|
||||
Console.WriteLine("Done...");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
109
libsecondlife-cs/examples/ImageTool/ImageTool.csproj
Normal file
109
libsecondlife-cs/examples/ImageTool/ImageTool.csproj
Normal file
@@ -0,0 +1,109 @@
|
||||
<VisualStudioProject>
|
||||
<CSHARP
|
||||
ProjectType = "Local"
|
||||
ProductVersion = "7.10.3077"
|
||||
SchemaVersion = "2.0"
|
||||
ProjectGuid = "{6ACF3FF4-CFA5-478B-993E-F788A1030CEB}"
|
||||
>
|
||||
<Build>
|
||||
<Settings
|
||||
ApplicationIcon = "App.ico"
|
||||
AssemblyKeyContainerName = ""
|
||||
AssemblyName = "ImageTool"
|
||||
AssemblyOriginatorKeyFile = ""
|
||||
DefaultClientScript = "JScript"
|
||||
DefaultHTMLPageLayout = "Grid"
|
||||
DefaultTargetSchema = "IE50"
|
||||
DelaySign = "false"
|
||||
OutputType = "Exe"
|
||||
PreBuildEvent = ""
|
||||
PostBuildEvent = ""
|
||||
RootNamespace = "ImageTool"
|
||||
RunPostBuildEvent = "OnBuildSuccess"
|
||||
StartupObject = "ImageTool.ImageTool"
|
||||
>
|
||||
<Config
|
||||
Name = "Debug"
|
||||
AllowUnsafeBlocks = "false"
|
||||
BaseAddress = "285212672"
|
||||
CheckForOverflowUnderflow = "false"
|
||||
ConfigurationOverrideFile = ""
|
||||
DefineConstants = "DEBUG;TRACE"
|
||||
DocumentationFile = ""
|
||||
DebugSymbols = "true"
|
||||
FileAlignment = "4096"
|
||||
IncrementalBuild = "false"
|
||||
NoStdLib = "false"
|
||||
NoWarn = ""
|
||||
Optimize = "false"
|
||||
OutputPath = "bin\Debug\"
|
||||
RegisterForComInterop = "false"
|
||||
RemoveIntegerChecks = "false"
|
||||
TreatWarningsAsErrors = "false"
|
||||
WarningLevel = "4"
|
||||
/>
|
||||
<Config
|
||||
Name = "Release"
|
||||
AllowUnsafeBlocks = "false"
|
||||
BaseAddress = "285212672"
|
||||
CheckForOverflowUnderflow = "false"
|
||||
ConfigurationOverrideFile = ""
|
||||
DefineConstants = "TRACE"
|
||||
DocumentationFile = ""
|
||||
DebugSymbols = "false"
|
||||
FileAlignment = "4096"
|
||||
IncrementalBuild = "false"
|
||||
NoStdLib = "false"
|
||||
NoWarn = ""
|
||||
Optimize = "true"
|
||||
OutputPath = "bin\Release\"
|
||||
RegisterForComInterop = "false"
|
||||
RemoveIntegerChecks = "false"
|
||||
TreatWarningsAsErrors = "false"
|
||||
WarningLevel = "4"
|
||||
/>
|
||||
</Settings>
|
||||
<References>
|
||||
<Reference
|
||||
Name = "System"
|
||||
AssemblyName = "System"
|
||||
HintPath = "..\..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll"
|
||||
/>
|
||||
<Reference
|
||||
Name = "System.Data"
|
||||
AssemblyName = "System.Data"
|
||||
HintPath = "..\..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll"
|
||||
/>
|
||||
<Reference
|
||||
Name = "System.XML"
|
||||
AssemblyName = "System.Xml"
|
||||
HintPath = "..\..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll"
|
||||
/>
|
||||
<Reference
|
||||
Name = "libsecondlife"
|
||||
Project = "{D9CDEDFB-8169-4B03-B57F-0DF638F044EC}"
|
||||
Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
|
||||
/>
|
||||
</References>
|
||||
</Build>
|
||||
<Files>
|
||||
<Include>
|
||||
<File
|
||||
RelPath = "App.ico"
|
||||
BuildAction = "Content"
|
||||
/>
|
||||
<File
|
||||
RelPath = "AssemblyInfo.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
<File
|
||||
RelPath = "ImageTool.cs"
|
||||
SubType = "Code"
|
||||
BuildAction = "Compile"
|
||||
/>
|
||||
</Include>
|
||||
</Files>
|
||||
</CSHARP>
|
||||
</VisualStudioProject>
|
||||
|
||||
5
libsecondlife-cs/examples/ImageTool/Readme.txt
Normal file
5
libsecondlife-cs/examples/ImageTool/Readme.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
SecondLife uses Kakadu Software's JPEG2000 framework to compress and expand images to/from JPEG2000.
|
||||
|
||||
Libsecondlife currently makes use of a freely available set of command line tools from Kakadu to support Image upload and download from SecondLife.
|
||||
|
||||
These tools are available from Kakadu's website at http://www.kakadusoftware.com/
|
||||
Reference in New Issue
Block a user