Advertisement
Fhernd

Principal.cs

Mar 12th, 2018
1,280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.02 KB | None | 0 0
  1. using System;
  2. using System.Drawing;
  3. using System.Windows.Forms;
  4.  
  5. namespace R805ImagenScroll
  6. {
  7.     public partial class Principal : Form
  8.     {
  9.         public Principal()
  10.         {
  11.             InitializeComponent();
  12.         }
  13.  
  14.         private void Principal_Load(object sender, EventArgs e)
  15.         {
  16.             string texto = "C#es un lenguaje de programación orientado a objetos.";
  17.             using (Font font = new Font("Trebushet", 20))
  18.             {
  19.                 Bitmap bmp = new Bitmap(600, 600);
  20.                 using (Graphics g = Graphics.FromImage(bmp))
  21.                 {
  22.                     g.FillRectangle(Brushes.White, new Rectangle(0, 0, bmp.Width, bmp.Height));
  23.  
  24.                     for (int i = 0; i < 10; i++)
  25.                     {
  26.                         g.DrawString(texto, font, Brushes.CadetBlue, 50, 50 * i * 60);
  27.                     }
  28.                 }
  29.  
  30.                 pbxImagen.BackgroundImage = bmp;
  31.                 pbxImagen.Size = bmp.Size;
  32.             }
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement