Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Drawing;
- using System.Drawing.Imaging;
- namespace WriteEMF
- {
- class Program
- {
- static void Main(string[] args)
- {
- using (var img = new Bitmap(200, 200))
- using (var g = Graphics.FromImage(img))
- {
- Pen penBlue = new Pen(Color.CadetBlue, 2);
- Brush brushRed = new SolidBrush(Color.IndianRed);
- Font fontMessage = new Font(SystemFonts.DefaultFont.FontFamily, 14);
- g.DrawBezier(penBlue, new Point(0, 0), new Point(50, 100), new Point(100, 50), new Point(0, 0));
- g.DrawString("Salut les moches !", fontMessage, brushRed, new Point((int)(200 - g.MeasureString("Salut les moches !", fontMessage).Width) / 2, 80));
- g.Flush();
- img.Save("Test.emf", ImageFormat.Emf);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement