From d373e13303cb10b9a0c996a11b48ea8b2f1d7c0e Mon Sep 17 00:00:00 2001 From: Jim Radford Date: Thu, 28 May 2009 00:02:55 +0000 Subject: [PATCH] Updates GroupManager application to use progressive texture downloads for the insignia as an example. Decoding looks like it still needs some love. git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@2824 52acb1d6-8a22-11de-b505-999d5b087335 --- .../groupmanager/frmGroupInfo.Designer.cs | 12 ++++++++++ .../examples/groupmanager/frmGroupInfo.cs | 24 ++++++++++++++++--- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/Programs/examples/groupmanager/frmGroupInfo.Designer.cs b/Programs/examples/groupmanager/frmGroupInfo.Designer.cs index 89bb4ee9..6cf70884 100644 --- a/Programs/examples/groupmanager/frmGroupInfo.Designer.cs +++ b/Programs/examples/groupmanager/frmGroupInfo.Designer.cs @@ -93,6 +93,7 @@ namespace groupmanager this.cmdCancel = new System.Windows.Forms.Button(); this.cmdOK = new System.Windows.Forms.Button(); this.cmdRefresh = new System.Windows.Forms.Button(); + this.labelInsigniaProgress = new System.Windows.Forms.Label(); this.tabs.SuspendLayout(); this.tabGeneral.SuspendLayout(); this.grpPreferences.SuspendLayout(); @@ -124,6 +125,7 @@ namespace groupmanager // // tabGeneral // + this.tabGeneral.Controls.Add(this.labelInsigniaProgress); this.tabGeneral.Controls.Add(this.grpPreferences); this.tabGeneral.Controls.Add(this.lstMembers); this.tabGeneral.Controls.Add(this.txtCharter); @@ -716,6 +718,15 @@ namespace groupmanager this.cmdRefresh.Text = "Refresh from server"; this.cmdRefresh.UseVisualStyleBackColor = true; // + // labelInsigniaProgress + // + this.labelInsigniaProgress.AutoSize = true; + this.labelInsigniaProgress.Location = new System.Drawing.Point(23, 149); + this.labelInsigniaProgress.Name = "labelInsigniaProgress"; + this.labelInsigniaProgress.Size = new System.Drawing.Size(54, 13); + this.labelInsigniaProgress.TabIndex = 7; + this.labelInsigniaProgress.Text = "Loading..."; + // // frmGroupInfo // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -824,6 +835,7 @@ namespace groupmanager private System.Windows.Forms.TextBox txtDetails; private System.Windows.Forms.TabPage tabSales; private System.Windows.Forms.TextBox txtSales; + private System.Windows.Forms.Label labelInsigniaProgress; } } diff --git a/Programs/examples/groupmanager/frmGroupInfo.cs b/Programs/examples/groupmanager/frmGroupInfo.cs index 40768b13..73af31d7 100644 --- a/Programs/examples/groupmanager/frmGroupInfo.cs +++ b/Programs/examples/groupmanager/frmGroupInfo.cs @@ -76,17 +76,35 @@ namespace groupmanager ManagedImage imgData; Image bitmap; - if (state == TextureRequestState.Finished) + if (state != TextureRequestState.Timeout || state != TextureRequestState.NotFound) { OpenJPEG.DecodeToImage(assetTexture.AssetData, out imgData, out bitmap); picInsignia.Image = bitmap; - } - }); + UpdateInsigniaProgressText("Progress..."); + } + if (state == TextureRequestState.Finished) + { + UpdateInsigniaProgressText(""); + } + }, true); if (this.InvokeRequired) this.BeginInvoke(new MethodInvoker(UpdateProfile)); } + private void UpdateInsigniaProgressText(string resultText) + { + if (this.InvokeRequired) + { + this.BeginInvoke(new MethodInvoker(delegate() + { + UpdateInsigniaProgressText(resultText); + })); + } + else + labelInsigniaProgress.Text = resultText; + } + private void UpdateProfile() { lblGroupName.Text = Profile.Name;