fork download
  1. using System;
  2. using System.Drawing;
  3. using System.Windows.Forms;
  4.  
  5. namespace AnimationTest3a
  6. {
  7. public class Form1 : Form
  8. {
  9. Timer timer1;
  10. PictureBox pictureBox1;//PictureBox
  11. Panel panel1;//Panel
  12. int x = 0;
  13. int y = 20;
  14. const int radius = 50;
  15. Brush bg_brush = new SolidBrush(SystemColors.Control);
  16. Brush fg_brush = new SolidBrush(Color.Black);
  17. System.ComponentModel.IContainer components = null;
  18. protected override void Dispose(bool disposing)
  19. {
  20. if (disposing && (components != null)) components.Dispose();
  21. base.Dispose(disposing);
  22. }
  23. public Form1()
  24. {
  25. this.components = new System.ComponentModel.Container();
  26. this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
  27. timer1 = new Timer();
  28. timer1.Interval = 20;
  29. timer1.Tick += timer1_Tick;
  30. pictureBox1 = new PictureBox();//PictureBox
  31. panel1 = new Panel();//Panel
  32. this.Controls.Add(pictureBox1);
  33. this.ClientSize = new Size(600, 200);
  34. #if DEBUG
  35. panel1.Size = new Size(600, 200);
  36. panel1.Location = new Point(0, 200);
  37. this.Controls.Add(panel1);
  38. this.ClientSize = new Size(600, 400);
  39. #endif
  40. pictureBox1.Size = new Size(600, 200);
  41. pictureBox1.BorderStyle = BorderStyle.FixedSingle;
  42. pictureBox1.Image = new Bitmap(600, 200);
  43. timer1.Start();
  44. }
  45. private void timer1_Tick(object sender, EventArgs e)
  46. {
  47. timer1.Enabled = false;
  48. Graphics g = Graphics.FromImage(pictureBox1.Image);
  49. int x2 = x + 2;
  50. g.FillRectangle(fg_brush, x2, y, radius, radius);
  51. g.FillRectangle(bg_brush, x, y, x2 - x, radius);
  52. x = x2;
  53. g.Dispose();
  54. #if DEBUG
  55. panel1.BackgroundImage = pictureBox1.Image;
  56. #endif
  57. this.Refresh();
  58. if (x > 550)
  59. {
  60. x = 0; x2 = 0;
  61. pictureBox1.Image = new Bitmap(600, 200);
  62. }
  63. timer1.Enabled = true;
  64. }
  65. }
  66. static class Program
  67. {
  68. [STAThread]
  69. static void Main()
  70. {
  71. Application.EnableVisualStyles();
  72. Application.SetCompatibleTextRenderingDefault(false);
  73. Application.Run(new Form1());
  74. }
  75. }
  76. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(3,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(7,23): error CS0246: The type or namespace name `Form' could not be found. Are you missing an assembly reference?
prog.cs(9,9): error CS0246: The type or namespace name `Timer' could not be found. Are you missing `System.Threading' or `System.Timers' using directive?
prog.cs(10,9): error CS0246: The type or namespace name `PictureBox' could not be found. Are you missing an assembly reference?
prog.cs(11,9): error CS0246: The type or namespace name `Panel' could not be found. Are you missing an assembly reference?
prog.cs(18,33): error CS0115: `AnimationTest3a.Form1.Dispose(bool)' is marked as an override but no suitable method found to override
Compilation failed: 6 error(s), 0 warnings
stdout
Standard output is empty