I have a 2D array of chairs like this: chairs[][] also here is my chair class:
public class Chair
{
public int State;
public int number;
}
Each object of class represent a seat in a theater (state indicates the seat status; 0 means empty, 1 means reserved and number indicates the seat number).
Let's assume that I have these values:
0 0 0 1
1 1 1 0
0 1 0 1
I want to create array of images like this:
and finally convert it to array of bytes and return it as web service output. long story short i want to convert array of chair[][] to the images. my web service input will be chairs[][] and output will be byte[].
Is this possible?
UPDATE:
here i created something in windows desktop application. i just need create it in wcf. i have now idea how can create Picturebox or Labal in wcf!!!
{
AutoScroll = true;
int x = 10, y = 10;
Chair[][] chairs = new Chair[3][];
chairs[0] = new Chair[4] { new Chair { number = 1, State = 0 }, new Chair { number = 2, State = 0 }, new Chair { number = 3, State = 0 }, new Chair { number = 4, State = 1 } };
chairs[1] = new Chair[4] { new Chair { number = 5, State = 1 }, new Chair { number = 6, State = 1 }, new Chair { number = 7, State = 1 }, new Chair { number = 8, State = 0 } };
chairs[2] = new Chair[4] { new Chair { number = 9, State = 0 }, new Chair { number = 10, State = 1 }, new Chair { number = 11, State = 0 }, new Chair { number = 12, State = 1 } };
Label[][] label = new Label[chairs.Length][];
PictureBox[][] picturebox = new PictureBox[chairs.Length][];
for (int i = 0; i < chairs.Length; i++)
{
label[i] = new Label[chairs[i].Length];
picturebox[i] = new PictureBox[chairs[i].Length];
for (int j = 0; j < chairs[i].Length; j++)
{
label[i][j] = new Label();
picturebox[i][j] = new PictureBox();
Controls.Add(label[i][j]);
Controls.Add(picturebox[i][j]);
label[i][j].Location = new Point(x, y + 50);
picturebox[i][j].Location = new Point(x, y);
label[i][j].Size = new Size(100, 20);
picturebox[i][j].Size = new Size(50, 50);
label[i][j].Text = i + "*" + j + "(" + chairs[i][j].number + ")";
if (chairs[i][j].State == 0) picturebox[i][j].Image = Image.FromFile(@"C:\Users\Admin\Desktop\1\1.png");
else picturebox[i][j].Image = Image.FromFile(@"C:\Users\Admin\Desktop\1\2.png");
x = x + 100;
}
x = 10;
y = y + 100;
}
