I'm trying to develop a poker replayer hands but I am facing a problem that does not really know how to solve. With the methods below:
public Replayer() //ctor
{
InitializeComponent();
pics = null;
iCounter = 0;
bShow = true;
var pos = picTable.PointToScreen(picTable.Location);
pos = picTable.PointToClient(pos);
picTable.Parent = picBackground;
picTable.Location = pos;
picTable.BackColor = Color.Transparent;
TenPlayerHoldem(); // for only test
}
private void TenPlayerHoldem() // only test
{
int iCounter = 10;
pics = new PictureBox[10];
for(int i = 0; i < iCounter; i++)
{
pics[i] = new PictureBox();
pics[i].Name = "pics" + i.ToString();
pics[i].Size = new Size(148, 74);
pics[i].Image = FreePokerReplayer.Properties.Resources.seatbold;
pics[i].SizeMode = PictureBoxSizeMode.StretchImage;
pics[i].BackColor = Color.Transparent;
pics[i].Visible = true;
pics[i].MouseClick += new MouseEventHandler(pics_Click);
picTable.Controls.Add(pics[i]);
}
pics[0].Location = new Point(379, 410);
var pos00 = pics[0].PointToScreen(pics[0].Location);
pos00 = pics[0].PointToClient(pos00);
pics[0].Parent = picTable;
pics[0].Location = pos00;
pics[1].Location = new Point(188, 377);
var pos01 = pics[1].PointToScreen(pics[1].Location);
pos01 = pics[1].PointToClient(pos01);
pics[1].Parent = picTable;
pics[1].Location = pos01;
pics[2].Location = new Point(56, 288);
var pos02 = pics[2].PointToScreen(pics[2].Location);
pos02 = pics[2].PointToClient(pos02);
pics[2].Parent = picTable;
pics[2].Location = pos02;
So with the code:
//another picturebox
var poscard = pictureBox1.PointToScreen(pictureBox1.Location);
poscard = pictureBox1.PointToClient(poscard);
pictureBox1.Parent = picTable;
pictureBox1.Location = poscard;
the card is cut off ... I tried everything I knew to solve but no use. Any idea how to make the card appear behind the image, that is, part of the card be hidden without this "cut"?
Grateful for the help.