private void timer1_Tick(object sender, EventArgs e) { label1.Text = timerDuration.ToString(); timerDuration--; if (timerDuration == -1) { timer1.Stop(); Request req = new Request(); req.setState(drawingId, 1); MessageReport msg = new MessageReport("Whooops......"); msg.Show(); this.Close(); } }
private void sendImagetoServer() { Bitmap bmp = new Bitmap(panel2.Width, panel2.Height); Graphics g = Graphics.FromImage(bmp); Rectangle rect = panel2.RectangleToScreen(panel2.ClientRectangle); g.CopyFromScreen(rect.Location, Point.Empty, panel2.Size); g.Dispose(); bmp.Save("drawedPicture.jpg", ImageFormat.Jpeg); string binaryFile = ImageToBase64(bmp, ImageFormat.Jpeg); Request req = new Request(); req.imagePost(wordId, userId, friendId, binaryFile); MessageReport msg = new MessageReport("Picture was sent."); msg.Show(); timer1.Stop(); this.Close(); }
private void sendToServer() { if (guessBox.Text == "") { MessageReport msg = new MessageReport("Empty field"); msg.Show(); } else { if (SubmitGuess()) { MessageReport msg = new MessageReport("Nice. Your guess was successful."); msg.Show(); this.Close(); } else { MessageReport msg = new MessageReport("Try again."); msg.Show(); } } }