public Window CreateWindow() { // Create a window object and set its size to the // size of the display. mainWindow = new Window(); mainWindow.Height = SystemMetrics.ScreenHeight; mainWindow.Width = SystemMetrics.ScreenWidth; mainWindow.Background = new SolidColorBrush(Color.Black); imageView = new Image(); imageView.HorizontalAlignment = Microsoft.SPOT.Presentation.HorizontalAlignment.Center; imageView.VerticalAlignment = Microsoft.SPOT.Presentation.VerticalAlignment.Center; mainWindow.Child = imageView; mainWindow.AddHandler(Buttons.ButtonDownEvent, new ButtonEventHandler(OnButtonDown), false); mainWindow.Visibility = Visibility.Visible; Buttons.Focus(mainWindow); // Create camera camera = new C328R(new SerialPort.Configuration(SerialPort.Serial.COM2, SerialPort.BaudRate.Baud115200, false)); InitCamera(); return mainWindow; }
public Window CreateWindow() { // Create a window object and set its size to the // size of the display. mainWindow = new Window(); mainWindow.Height = SystemMetrics.ScreenHeight; mainWindow.Width = SystemMetrics.ScreenWidth; mainWindow.Background = new SolidColorBrush(Color.Black); imageView = new Image(); imageView.HorizontalAlignment = Microsoft.SPOT.Presentation.HorizontalAlignment.Center; imageView.VerticalAlignment = Microsoft.SPOT.Presentation.VerticalAlignment.Center; mainWindow.Child = imageView; mainWindow.AddHandler(Buttons.ButtonDownEvent, new ButtonEventHandler(OnButtonDown), false); mainWindow.Visibility = Visibility.Visible; Buttons.Focus(mainWindow); // Create camera camera = new C328R(new SerialPort.Configuration(SerialPort.Serial.COM2, SerialPort.BaudRate.Baud115200, false)); InitCamera(); return(mainWindow); }