Files
libremetaverse/libsecondlife/examples/Baker/frmBaker.cs
John Hurliman 88e7d9397c * Fixed up the Baker example for bushing's experiments
* Removed the ThreadPool checks, it's a lost cause on Mono right now
* Moved ObjectManager RequestAllObjects and AlwaysDecode to the Settings class as ALWAYS_REQUEST_OBJECTS and ALWAYS_DECODE_OBJECTS
* TestClient uses the new Settings variables for object management
* Increased the CAPS timeout, we need to get the initial connection async quickly
* Added a post-build step for openjpegnet MSVC project to copy openjpeg.dll to the bin/ directory

git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1090 52acb1d6-8a22-11de-b505-999d5b087335
2007-04-01 09:52:13 +00:00

66 lines
1.8 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Imaging;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace Baker
{
public partial class frmBaker : Form
{
public frmBaker()
{
InitializeComponent();
}
private void frmBaker_Load(object sender, EventArgs e)
{
}
private void frmBaker_FormClosing(object sender, FormClosingEventArgs e)
{
}
private void cmdLoadPic_Click(object sender, EventArgs e)
{
Button caller = (Button)sender;
PictureBox pic = null;
switch (caller.Name)
{
case "cmdLoadPic1":
pic = pic1;
break;
case "cmdLoadPic2":
pic = pic2;
break;
case "cmdLoadPic3":
pic = pic3;
break;
}
if (pic != null)
{
OpenFileDialog dialog = new OpenFileDialog();
dialog.Filter = "JPEG2000 (*.jp2,*.j2c,*.j2k)|";
if (dialog.ShowDialog() == DialogResult.OK)
{
try
{
byte[] j2kdata = File.ReadAllBytes(dialog.FileName);
Image image = OpenJPEGNet.OpenJPEG.DecodeToImage(j2kdata);
pic.Image = image;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
}
}
}