Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Drawing;
- using System.Drawing.Imaging;
- //using System.Drawing.Drawing2D;
- namespace testeimg
- {
- public partial class _Default : System.Web.UI.Page
- {
- private void Page_Load(object sender, EventArgs e)
- {
- // Set the page's content type to JPEG files
- // and clears all content output from the buffer stream.
- Response.ContentType = "image/jpeg";
- Response.Clear();
- // Buffer response so that page is sent
- // after processing is complete.
- Response.BufferOutput = true;
- // Create a font style.
- Brush pincel = new SolidBrush(Color.Black);
- Font fontNome = new Font("Courier New", 36, FontStyle.Bold | FontStyle.Italic);
- Font fontEvento = new Font("Courier New", 24, FontStyle.Bold | FontStyle.Italic);
- Font fontPalestra = new Font("Courier New", 12, FontStyle.Bold | FontStyle.Italic);
- // Create a bitmap and use it to create a
- // Graphics object.
- Bitmap bmp = new Bitmap( System.Drawing.Image.FromFile(Server.MapPath("Certificado.jpg")));
- Graphics g = Graphics.FromImage(bmp);
- g.DrawString("Marcelo Pereira da Silva", fontNome, SystemBrushes.WindowText, new PointF( 100, 500));
- g.DrawString("Participou do evento online ...... - parte 1",fontEvento, SystemBrushes.WindowText, new PointF(100, 800));
- g.DrawString("com duaraçaõ de 2 horas, no dia ../../.., ás .. : .. h",fontEvento,SystemBrushes.WindowText, new PointF(100, 900));
- g.DrawString("Leroeouiuuiuir", fontPalestra, SystemBrushes.WindowText, new PointF(600, 1000));
- g.DrawString("testessteresvhgggggggggggggggggggggggggggggg", fontPalestra, SystemBrushes.WindowText, new PointF(600, 1050));
- g.DrawString("coisas do bancofggggggggggggggggggggggggggggggggggggggg ", fontPalestra, SystemBrushes.WindowText, new PointF(600, 1100));
- g.DrawString("finmdsfmsdfghghghghghghghghghghghghghghghghghghghghghhhhh", fontPalestra, SystemBrushes.WindowText, new PointF(600, 1150));
- // Save the bitmap to the response stream and
- // convert it to JPEG format.
- bmp.Save(Response.OutputStream, ImageFormat.Jpeg);
- // Release memory used by the Graphics object
- // and the bitmap.
- g.Dispose();
- bmp.Dispose();
- // Send the output to the client.
- Response.Flush();
- }
- }
- }
Add Comment
Please, Sign In to add comment