Programmation C sharp/Interfaces graphiques/Graphique vectoriel

Un premier graphique.
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
namespace test
 public partial class Form1 : Form
 private int yPos = 40;
 private PictureBox pictureBox1;
 private Graphics g;
 public Form1()
 this.InitializeComponent();
 this.Show();
 private void InitializeComponent()
 this.pictureBox1 = new PictureBox();
 ((ISupportInitialize) this.pictureBox1).BeginInit();
 this.SuspendLayout();
 // pictureBox1
 this.pictureBox1.Location = new Point(12, 12);
 this.pictureBox1.Name = "pictureBox1";
 this.pictureBox1.Size = new Size(268, 112);
 this.pictureBox1.TabIndex = 0;
 this.pictureBox1.TabStop = false;
 // Form1
 this.ClientSize = new Size(292, 141);
 this.Controls.Add(this.pictureBox1);
 this.Name = "Form1";
 ((ISupportInitialize) this.pictureBox1).EndInit();
 this.ResumeLayout(false);
 static void Main()
 Application.EnableVisualStyles();
 Application.SetCompatibleTextRenderingDefault(false);
 Application.Run(new Form1());
 private void Show()
 Bitmap bmp = new Bitmap(
 pictureBox1.Width, pictureBox1.Height);
 using (Graphics image = Graphics.FromImage(bmp))
 Pen myPen1 = new Pen(Color.Red);
 Pen myPen2 = new Pen(Color.Black);
 myPen1.Width = 5;
 myPen2.Width = 5;
 SolidBrush myBrush = new SolidBrush(Color.Red);
 Font myFont = new Font("Times New Roman", 24);
 // smile
 image.DrawLine(myPen2, 10, 5, 20, 5);
 image.DrawLine(myPen2, 55, 5, 65, 5);
 image.DrawBezier(myPen2, 15, 15, 15, 40, 60, 40, 60, 15);
 image.DrawString("~heLLo wErld ~", myFont, myBrush,
 10, (this.yPos = this.yPos + 25));
 } // using
 pictureBox1.Image = bmp;
Les méthodes appliquées ici sont issues de la classe codice_2 de .NET.
Pour afficher l'image il faut initialiser auparavant un constructeur de cette classe ou l'appeler par un évènement on_click par exemple.
Quelques méthodes.
La classe codice_2 comprend de nombreuses autres méthodes du genre. Dont :

Le système d'exploitation GNU-Linux/Configuration du réseau