bonjour
j'ai cree un canvas sur lequel je dessin une regle

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 
        protected override void OnRender(DrawingContext drawingContext)
        {
            base.OnRender(drawingContext);
 
            double h0 = (this.ActualHeight / 3);
            double h1 = (this.ActualHeight / 5);
 
            for (double i = 0; i < this.ActualWidth; i += 4)
            {
                double j = i + _StartPosition;
                double h = ((j % 10) == 0 ? h0 : h1);
                drawingContext.DrawLine(
                    new Pen(new SolidColorBrush(Colors.White), 1),
                    new Point(i, this.ActualHeight - h),
                    new Point(i, this.ActualHeight)
                    );
            }
 
        }
Nom : ruller.PNG
Affichages : 105
Taille : 955 octets

or a l'affichage de mon control j'ai un bon resultat (haut de l'image)
en execution (bas de l'image) j'ai un antialiasing plutot desagreable

une solution