Example #1
0
 public static void BmpImageTest(NwazetGoImaging.VirtualCanvas canvas)
 {
     try {
         var sd = new NwazetGoSD.SDCardReader();
         sd.Initialize(GoSockets.Socket8);
         DisplayBmpPicture(canvas, @"Nwazet\03.bmp");
         DisplayBmpPicture(canvas, @"Nwazet\05.bmp");
         DisplayBmpPicture(canvas, @"Nwazet\09.bmp");
         canvas.SetOrientation(NwazetGoImaging.Orientation.Landscape);
         DisplayBmpPicture(canvas, @"Nwazet\00.bmp");
         DisplayBmpPicture(canvas, @"Nwazet\01.bmp");
         DisplayBmpPicture(canvas, @"Nwazet\02.bmp");
         DisplayBmpPicture(canvas, @"Nwazet\04.bmp");
         DisplayBmpPicture(canvas, @"Nwazet\06.bmp");
         DisplayBmpPicture(canvas, @"Nwazet\07.bmp");
         DisplayBmpPicture(canvas, @"Nwazet\08.bmp");
         sd.Dispose();
     }catch (Exception e) {
         Debug.Print(e.Message);
         Debug.Print("You need an SD card loaded with the demo photos to run this part of the demo.");
     }
 }
Example #2
0
 public static void CalibrateTouchscreen(NwazetGoImaging.VirtualCanvas canvas)
 {
     try
     {
         var sd = new NwazetGoSD.SDCardReader();
         sd.Initialize(GoSockets.Socket8);
         var calibrationDataFilename = @"SD\TouchscreenCalibration.bin";
         // If the touchscreen calibration data was previously retrieved from the display module and was stored to an SD card,
         // the calibration data can be sent to the display module instead of calling TouchscreenCalibration() before using
         // the touchscreen for the first time.
         if (File.Exists(calibrationDataFilename))
         {
             using (var calibrationDataFile = new FileStream(calibrationDataFilename, FileMode.Open))
             {
                 var context = new NwazetGoHelpers.BasicTypeDeSerializerContext(calibrationDataFile);
                 var matrix  = new NwazetGoDisplayTouchScreen.CalibrationMatrix();
                 matrix.Get(context);
                 canvas.SetTouchscreenCalibrationMatrix(matrix);
             }
         }
         else
         {
             // No pre-existing calibration data, create it...
             using (var calibrationDataFile = new FileStream(calibrationDataFilename, FileMode.Create))
             {
                 var matrix  = canvas.GetTouchscreenCalibrationMatrix();
                 var context = new NwazetGoHelpers.BasicTypeSerializerContext(calibrationDataFile);
                 matrix.Put(context);
             }
         }
         sd.Dispose();
     }
     catch (Exception)
     {
         Debug.Print("SD Card or file I/O error: manual calibration required.");
         canvas.TouchscreenCalibration();
     }
 }
Example #3
0
 public static void CalibrateTouchscreen(NwazetGoImaging.VirtualCanvas canvas)
 {
     try
     {
         var sd = new NwazetGoSD.SDCardReader();
         sd.Initialize(GoSockets.Socket8);
         var calibrationDataFilename = @"SD\TouchscreenCalibration.bin";
         // If the touchscreen calibration data was previously retrieved from the display module and was stored to an SD card,
         // the calibration data can be sent to the display module instead of calling TouchscreenCalibration() before using
         // the touchscreen for the first time.
         if (File.Exists(calibrationDataFilename))
         {
             using (var calibrationDataFile = new FileStream(calibrationDataFilename, FileMode.Open))
             {
                 var context = new NwazetGoHelpers.BasicTypeDeSerializerContext(calibrationDataFile);
                 var matrix = new NwazetGoDisplayTouchScreen.CalibrationMatrix();
                 matrix.Get(context);
                 canvas.SetTouchscreenCalibrationMatrix(matrix);
             }
         }
         else
         {
             // No pre-existing calibration data, create it...
             using (var calibrationDataFile = new FileStream(calibrationDataFilename, FileMode.Create))
             {
                 var matrix = canvas.GetTouchscreenCalibrationMatrix();
                 var context = new NwazetGoHelpers.BasicTypeSerializerContext(calibrationDataFile);
                 matrix.Put(context);
             }
         }
         sd.Dispose();
     }
     catch (Exception)
     {
         Debug.Print("SD Card or file I/O error: manual calibration required.");
         canvas.TouchscreenCalibration();
     }
 }
Example #4
0
 public static void BmpImageTest(NwazetGoImaging.VirtualCanvas canvas)
 {
     try {
         var sd = new NwazetGoSD.SDCardReader();
         sd.Initialize(GoSockets.Socket8);
         DisplayBmpPicture(canvas, @"Nwazet\03.bmp");
         DisplayBmpPicture(canvas, @"Nwazet\05.bmp");
         DisplayBmpPicture(canvas, @"Nwazet\09.bmp");
         canvas.SetOrientation(NwazetGoImaging.Orientation.Landscape);
         DisplayBmpPicture(canvas, @"Nwazet\00.bmp");
         DisplayBmpPicture(canvas, @"Nwazet\01.bmp");
         DisplayBmpPicture(canvas, @"Nwazet\02.bmp");
         DisplayBmpPicture(canvas, @"Nwazet\04.bmp");
         DisplayBmpPicture(canvas, @"Nwazet\06.bmp");
         DisplayBmpPicture(canvas, @"Nwazet\07.bmp");
         DisplayBmpPicture(canvas, @"Nwazet\08.bmp");
         sd.Dispose();
     }catch(Exception e){
         Debug.Print(e.Message);
         Debug.Print("You need an SD card loaded with the demo photos to run this part of the demo.");
     }
 }