Created
March 13, 2018 02:28
-
-
Save Fhernd/7b63d4397aa2a25d848fc0e116e5d5fa to your computer and use it in GitHub Desktop.
OrtizOL. Imagen con scroll. C#.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Drawing; | |
using System.Windows.Forms; | |
namespace R805ImagenScroll | |
{ | |
public partial class Principal : Form | |
{ | |
public Principal() | |
{ | |
InitializeComponent(); | |
} | |
private void Principal_Load(object sender, EventArgs e) | |
{ | |
string texto = "C#es un lenguaje de programación orientado a objetos."; | |
using (Font font = new Font("Trebushet", 20)) | |
{ | |
Bitmap bmp = new Bitmap(600, 600); | |
using (Graphics g = Graphics.FromImage(bmp)) | |
{ | |
g.FillRectangle(Brushes.White, new Rectangle(0, 0, bmp.Width, bmp.Height)); | |
for (int i = 0; i < 10; i++) | |
{ | |
g.DrawString(texto, font, Brushes.CadetBlue, 50, 50 * i * 60); | |
} | |
} | |
pbxImagen.BackgroundImage = bmp; | |
pbxImagen.Size = bmp.Size; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment