MoonDragon
Not my original code but this does the same thing. I do not have a web cam (or cell phone) so I cannot post a picture. I guess I am the only person on earth without a cell phone…
using System;
using System.Collections;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;
using Microsoft.SPOT.Touch;
//A Gadgeteer console application
using Gadgeteer.Networking;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Gadgeteer.Modules.GHIElectronics;
namespace GadgeteerApp1
{
public partial class Program
{
private Text txtSerial;
private Text test;
private Canvas canvas;
private Font baseFont;
void ProgramStarted()
{
SetupWindow();
Debug.Print("Program Started");
}
private void SetupWindow()
{
var window = display.WPFWindow;
baseFont = Resources.GetFont(Resources.FontResources.NinaB);
canvas = new Canvas();
window.Child = canvas;
//
// The following displays as intended: (OK)
//
txtSerial = new Text(baseFont, "The serial device is open");
canvas.Children.Add(txtSerial);
Canvas.SetTop(txtSerial, 40);
Canvas.SetLeft(txtSerial, 60);
// The following displays as: The serial device is...
//
txtSerial = new Text(baseFont, "The serial device is open\n");
canvas.Children.Add(txtSerial);
Canvas.SetTop(txtSerial, 60);
Canvas.SetLeft(txtSerial, 60);
// The following displays as: The serial...
//
txtSerial = new Text(baseFont, "The serial device\r\nis not open\r\n");
canvas.Children.Add(txtSerial);
Canvas.SetTop(txtSerial, 80);
Canvas.SetLeft(txtSerial, 60);
// The following displays as: What looks like the Alt 0141 character (a vertical outlined rectangle) then ...
//
txtSerial = new Text(baseFont, "\r\nThe serial device is not open");
canvas.Children.Add(txtSerial);
Canvas.SetTop(txtSerial, 100);
Canvas.SetLeft(txtSerial, 60);
// The following displays as: What looks like the Alt 0141 character (a vertical outlined rectangle) then The serial device is not open
//
txtSerial = new Text(baseFont, "\rThe serial device is not open");
canvas.Children.Add(txtSerial);
Canvas.SetTop(txtSerial, 120);
Canvas.SetLeft(txtSerial, 60);
// The following displays as intended: (OK)
//
test = new Text(baseFont, "01234567890123456789012345678901234567890123456789\n");
canvas.Children.Add(test);
Canvas.SetTop(test, 180);
Canvas.SetLeft(test, 0);
// The following displays as: 0123456789012345678901234567...
//
test = new Text(baseFont, "012345678901234567890123456789\n01234567890123456789");
canvas.Children.Add(test);
Canvas.SetTop(test, 200);
Canvas.SetLeft(test, 0);
// The following displays as intended: (OK)
//
test = new Text(baseFont, "01234567890123456789012345678901234567890123456789");
canvas.Children.Add(test);
Canvas.SetTop(test, 227);
Canvas.SetLeft(test, 0);
}
} //end class
}
For Skewworks
Thanks for the link. Now that you post it I remember seeing it!
I will try and see if I can do something with it…