Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint e.Graphics.FillRectangle(Brushes.DarkGoldenrod, New Rectangle(0, 0, 100, 100)) End Sub |
void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { e.Graphics.FillRectangle(Brushes.DarkGoldenrod , new Rectangle(0, 0, 100, 100)); } |
Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click B += 10 'B symbolizes the location of something moving on the form. End Sub Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint e.Graphics.FillRectangle(Brushes.DarkGoldenrod, New Rectangle(B, B, 100, 100)) End Sub |
void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { e.Graphics.FillRectangle(Brushes.DarkGoldenrod , new Rectangle(b, b, 100, 100)); } void Form1_Click(object sender, System.EventArgs e) { b += 10; //b symbolizes a location of something on the form. } |
Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click B += 10 'B symbolizes the location of something moving on the form. Me.Invalidate() 'Calls Paint event and refreshes display. End Sub Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint e.Graphics.FillRectangle(Brushes.DarkGoldenrod, New Rectangle(B, B, 100, 100)) End Sub |
void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { e.Graphics.FillRectangle(Brushes.DarkGoldenrod , new Rectangle(b, b, 100, 100)); } void Form1_Click(object sender, System.EventArgs e) { b += 10; //b symbolizes a location of something on the form. this.Invalidate(); //Calls the Paint event and refreshes the display. } |
Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click B += 10 'B symbolizes the location of something moving on the form. Me.Invalidate() 'Calls Paint event and refreshes display. End Sub Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint e.Graphics.FillRectangle(Brushes.Black, Me.ClientRectangle) 'Black background. e.Graphics.FillRectangle(Brushes.DarkGoldenrod, New Rectangle(B, B, 100, 100)) End Sub |
void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { e.Graphics.FillRectangle(Brushes.Black, this.ClientRectangle); //Black background. e.Graphics.FillRectangle(Brushes.DarkGoldenrod , new Rectangle(b, b, 100, 100)); } void Form1_Click(object sender, System.EventArgs e) { b += 10; //b symbolizes a location of something on the form. this.Invalidate(); //Calls the Paint event and refreshes the display. } |
Dim Backup As System.Drawing.Bitmap 'Memory buffer - will be drawn in one fell swoop. Dim GFX As System.Drawing.Graphics 'Should draw to the memory buffer declared above. Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Backup = New Bitmap(200, 200) '200x200 is the size of the memory bitmap, which will 'effectively be the size of the display, since nothing can go off of it. GFX = Graphics.FromImage(Backup) End Sub |
System.Drawing.Bitmap backup; //Memory bitmap that will hold drawings that will be drawn all at once. System.Drawing.Graphics gfx; //Draws the drawings to the memory bitmap above. private void Form1_Load(object sender, EventArgs e) { backup = new Bitmap(200, 200); //200x200 is the size of the memory bitmap, which is effectively going to be the display size. gfx = Graphics.FromImage(backup); //Set gfx to drawn to this backup bitmap. } |
Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click B += 10 'B symbolizes the location of something moving on the form. GFX.FillRectangle(Brushes.Black, Me.ClientRectangle) GFX.FillRectangle(Brushes.DarkGoldenrod, New Rectangle(B, B, 100, 100)) 'Draws to the backup bitmap. End Sub |
void Form1_Click(object sender, System.EventArgs e) { b += 10; //b symbolizes a location of something on the form. gfx.FillRectangle(Brushes.Black, this.ClientRectangle); //Black background. gfx.FillRectangle(Brushes.DarkGoldenrod, new Rectangle(b, b, 100, 100)); } |
Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click B += 10 'B symbolizes the location of something moving on the form. GFX.FillRectangle(Brushes.Black, Me.ClientRectangle) GFX.FillRectangle(Brushes.DarkGoldenrod, New Rectangle(B, B, 100, 100)) 'Draws to the backup bitmap. Me.Invalidate() End Sub Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint e.Graphics.DrawImage(Backup, 0, 0) End Sub |
void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { e.Graphics.DrawImage(backup, 0, 0); } void Form1_Click(object sender, System.EventArgs e) { b += 10; //b symbolizes a location of something on the form. gfx.FillRectangle(Brushes.Black, this.ClientRectangle); //Black background. gfx.FillRectangle(Brushes.DarkGoldenrod, new Rectangle(b, b, 100, 100)); this.Invalidate(); } |
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Backup = New Bitmap(200, 200) '200x200 is the size of the memory bitmap, which will 'effectively be the size of the display, since nothing can go off of it. GFX = Graphics.FromImage(Backup) 'Draws to the memory buffer. FGFX = Me.CreateGraphics() 'Draws to the display (form). End Sub |
private void Form1_Load(object sender, EventArgs e) { backup = new Bitmap(200, 200); //200x200 is the size of the memory bitmap, which is effectively going to be the display size. gfx = Graphics.FromImage(backup); //Set gfx to draw to this backup bitmap. fgfx = this.CreateGraphics(); //Set fgfx to draw to the display (form). } |
Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click B += 10 'B symbolizes the location of something moving on the form. GFX.FillRectangle(Brushes.Black, Me.ClientRectangle) GFX.FillRectangle(Brushes.DarkGoldenrod, New Rectangle(B, B, 100, 100)) 'Draws to the backup bitmap. FGFX.DrawImage(Backup, 0, 0) 'Present the memory bitmap to the display. End Sub Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint FGFX.DrawImage(Backup, 0, 0) 'Present the memory bitmap to the display. End Sub |
void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { fgfx.DrawImage(backup, 0, 0); //Present memory bitmap to the display. } void Form1_Click(object sender, System.EventArgs e) { b += 10; //b symbolizes a location of something on the form. gfx.FillRectangle(Brushes.Black, this.ClientRectangle); //Black background. gfx.FillRectangle(Brushes.DarkGoldenrod, new Rectangle(b, b, 100, 100)); fgfx.DrawImage(backup, 0, 0); //Present memory bitmap to the display. } |
Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click B += 10 'B symbolizes the location of something moving on the form. GFX.FillRectangle(Brushes.Black, Me.ClientRectangle) GFX.FillRectangle(Brushes.DarkGoldenrod, New Rectangle(B, B, 100, 100)) 'Draws to the backup bitmap. Present() End Sub Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint Present() End Sub Private Sub Present() FGFX.DrawImage(Backup, 0, 0) 'Present the memory bitmap to the display. End Sub |
void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { Present(); } void Form1_Click(object sender, System.EventArgs e) { b += 10; //b symbolizes a location of something on the form. gfx.FillRectangle(Brushes.Black, this.ClientRectangle); //Black background. gfx.FillRectangle(Brushes.DarkGoldenrod, new Rectangle(b, b, 100, 100)); Present(); } void Present() { fgfx.DrawImage(backup, 0, 0); //Present memory bitmap to the display. } |
Private Sub Clock_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Clock.Tick Present() End Sub |
private void clock_Tick(object sender, EventArgs e) { Present(); } |