take profile photos by android phone (still very buggy)

This commit is contained in:
Alexander Eckart committed 2013-05-06 22:08:59 +02:00
1 parent da843b4f06
commit 6d008cdc06
17 files changed
+339 -48

No files matched your search

+14
View File
@@ -47,6 +47,7 @@
this.btRight = new System.Windows.Forms.Button();
this.btUp = new System.Windows.Forms.Button();
this.btDown = new System.Windows.Forms.Button();
this.btSendAvatar = new System.Windows.Forms.Button();
this.statusStrip1.SuspendLayout();
this.SuspendLayout();
//
@@ -227,11 +228,23 @@
this.btDown.UseVisualStyleBackColor = true;
this.btDown.Click += new System.EventHandler(this.btDown_Click);
//
// btSendAvatar
//
this.btSendAvatar.Enabled = false;
this.btSendAvatar.Location = new System.Drawing.Point(831, 310);
this.btSendAvatar.Name = "btSendAvatar";
this.btSendAvatar.Size = new System.Drawing.Size(165, 23);
this.btSendAvatar.TabIndex = 14;
this.btSendAvatar.Text = "Send Avatar";
this.btSendAvatar.UseVisualStyleBackColor = true;
this.btSendAvatar.Click += new System.EventHandler(this.btSendAvatar_Click);
//
// ClientTest
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1008, 550);
this.Controls.Add(this.btSendAvatar);
this.Controls.Add(this.btDown);
this.Controls.Add(this.btUp);
this.Controls.Add(this.btRight);
@@ -279,6 +292,7 @@
private System.Windows.Forms.Button btRight;
private System.Windows.Forms.Button btUp;
private System.Windows.Forms.Button btDown;
private System.Windows.Forms.Button btSendAvatar;
}
}
+25 -4
View File
@@ -118,6 +118,7 @@ namespace ClientTest
btDown.Enabled = true;
btLeft.Enabled = true;
btRight.Enabled = true;
btSendAvatar.Enabled = true;
});
}
else
@@ -134,6 +135,7 @@ namespace ClientTest
btDown.Enabled = false;
btLeft.Enabled = false;
btRight.Enabled = false;
btSendAvatar.Enabled = false;
});
}
}
@@ -144,9 +146,12 @@ namespace ClientTest
return;
string text = String.Empty;
foreach (byte b in Message)
int max = Message.Length;
if (max > 1000)
max = 1000;
for (int i = 0; i < max; i++)
{
text += b.ToString() + " ";
text += Message[i].ToString() + " ";
}
this.Invoke((MethodInvoker)delegate
@@ -161,9 +166,12 @@ namespace ClientTest
return;
string text = String.Empty;
foreach (byte b in Message)
int max = Message.Length;
if (max > 1000)
max = 1000;
for (int i = 0; i < max; i++)
{
text += b.ToString() + " ";
text += Message[i].ToString() + " ";
}
this.Invoke((MethodInvoker)delegate
@@ -203,5 +211,18 @@ namespace ClientTest
client.SendMessage(CCommands.CreateCommandWithoutParams(CCommands.CommandSendKeyRight), null);
}
private void btSendAvatar_Click(object sender, EventArgs e)
{
if (!client.Connected || !loggedIn)
return;
byte[] data = new byte[512 * 512 * 4];
for (int i = 0; i < data.Length; i++)
{
data[i] = (byte) (i % 255);
}
client.SendMessage(CCommands.CreateCommandSendAvatarPicture(512, 512, data), null);
}
}
}