/// <summary> /// Ustawienie avatara i zamknięcie okna. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonSetAvatar_Click(object sender, EventArgs e) { int width = panelAvatar.Size.Width; int height = panelAvatar.Size.Height; Bitmap bmp = new Bitmap(panelAvatar.Width, panelAvatar.Height); Graphics graph = Graphics.FromImage(bmp); Rectangle rectangle = new Rectangle(this.Location.X + 32, this.Location.Y + 81, 630, 1100);// pictureBox1.RectangleToScreen(pictureBox1.ClientRectangle); graph.CopyFromScreen(rectangle.Location, Point.Empty, panelAvatar.Size); graph.Dispose(); string fileName = "picture" + numberPicture + ".jpg"; bmp.Save(fileName, ImageFormat.Jpeg); bmp.Tag = fileName; windowChoicePlayer.SetAvatar(bmp); numberPicture++; Close(); }
/// <summary> /// Ustawienie zrobionego zdjęcia jako avatar. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonSetAvatar_Click(object sender, EventArgs e) { windowChoicePalyer.SetAvatar(pictureBoxTakePicture.Image); Close(); }