fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace AnimationTest2
  12. {
  13. public partial class Form1 : Form
  14. {
  15. Bitmap canvas;
  16. bool movable = true;
  17. int x = 0;
  18. int y = 50;
  19. const int radius = 50;
  20. int count = 0;
  21. Brush bg_brush = new SolidBrush(SystemColors.Control);
  22. Brush fg_brush = new SolidBrush(Color.Black);
  23.  
  24. public Form1()
  25. {
  26. InitializeComponent();
  27. canvas = new Bitmap(pictureBox1.Width, pictureBox1.Height);
  28. }
  29.  
  30. private void button1_Click(object sender, EventArgs e)
  31. {
  32. if (movable)
  33. {
  34. movable = false;
  35. timer1.Start();
  36. }
  37. }
  38.  
  39. private void timer1_Tick(object sender, EventArgs e)
  40. {
  41. Graphics g = Graphics.FromImage(canvas);
  42. g.FillEllipse(bg_brush, x, y, radius, radius);
  43. x += 10;
  44. g.FillEllipse(fg_brush, x, y, radius, radius);
  45. count++;
  46. g.Dispose();
  47. pictureBox1.Image = canvas;
  48. if (count == 20)
  49. {
  50. count = 0;
  51. movable = true;
  52. timer1.Stop();
  53. }
  54. }
  55. }
  56. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(4,14): error CS0234: The type or namespace name `Data' does not exist in the namespace `System'. Are you missing `System.Data' assembly reference?
prog.cs(9,22): error CS0234: The type or namespace name `Forms' does not exist in the namespace `System.Windows'. Are you missing `System.Windows.Forms' assembly reference?
prog.cs(13,31): error CS0246: The type or namespace name `Form' could not be found. Are you missing an assembly reference?
Compilation failed: 3 error(s), 0 warnings
stdout
Standard output is empty