Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Drawing;
- using System.Drawing.Drawing2D;
- using System.Windows.Forms;
- namespace R807DuplicarBufer
- {
- public partial class Principal : Form
- {
- private bool aumentandoTamahnio = false;
- private int tamahnioImagen = 0;
- private Image imagen;
- public Principal()
- {
- InitializeComponent();
- }
- private void tmrActualizacion_Tick(object sender, EventArgs e)
- {
- if (aumentandoTamahnio)
- {
- --tamahnioImagen;
- }
- else
- {
- ++tamahnioImagen;
- }
- if (tamahnioImagen > (Width - 150))
- {
- aumentandoTamahnio = true;
- }
- else if (tamahnioImagen < 1)
- {
- aumentandoTamahnio = false;
- }
- Invalidate();
- }
- private void Principal_Load(object sender, EventArgs e)
- {
- imagen = Image.FromFile(@"Resources\ball_8.png");
- tmrActualizacion.Start();
- }
- private void Principal_Paint(object sender, PaintEventArgs e)
- {
- Graphics g;
- g = e.Graphics;
- g.SmoothingMode = SmoothingMode.HighQuality;
- g.FillRectangle(Brushes.DarkCyan, new Rectangle(new Point(0, 0), ClientSize));
- g.DrawImage(imagen, 50, 50, 50 + tamahnioImagen, 50 + tamahnioImagen);
- }
- private void chkUsarDobleBufer_CheckedChanged(object sender, EventArgs e)
- {
- DoubleBuffered = chkUsarDobleBufer.Checked;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement