using System;
using System.Windows;
using System.Windows.Media;
class MainClass : Window
{
[STAThread]
public static void Main()
{
Application app = new Application();
app.Run(new MainClass());
}
public MainClass()
{
SimpleEllipse elips = new SimpleEllipse();
Content = elips;
}
}
class SimpleEllipse : FrameworkElement
{
protected override void OnRender(DrawingContext dc)
{
dc.DrawEllipse(Brushes.Blue, new Pen(Brushes.Red, 24),
new Point(RenderSize.Width / 2, RenderSize.Height / 2),
RenderSize.Width / 2, RenderSize.Height / 2);
}
}
|