예제 #1
0
        //--//

        public TouchScreen(ActiveRectangle[] activeRectangles)
        {
            int bpp, orientation;

            Microsoft.SPOT.Hardware.HardwareProvider hwProvider = Microsoft.SPOT.Hardware.HardwareProvider.HwProvider;
            hwProvider.GetLCDMetrics(out _maxWidth, out _maxHeight, out bpp, out orientation);

            if (activeRectangles == null || activeRectangles.Length == 0)
            {
                this.ActiveRegions = new ActiveRectangle[] { new ActiveRectangle(0, 0, _maxWidth, _maxHeight, null) };
            }
            else
            {
                this.ActiveRegions = activeRectangles;
            }
        }
예제 #2
0
        /// <summary>
        /// Execution entry point.
        /// </summary>
        public static void Main()
        {
            int width, height, bpp, orientation;

            Microsoft.SPOT.Hardware.HardwareProvider hwProvider = Microsoft.SPOT.Hardware.HardwareProvider.HwProvider;
            hwProvider.GetLCDMetrics(out width, out height, out bpp, out orientation);


            // allocate one bitmap to be used as drawing canvas
            MyTouchScreen myTouchScreen = new MyTouchScreen(new TouchScreen.ActiveRectangle[] { new TouchScreen.ActiveRectangle(10, 20, 100, 100, null) }, new Bitmap(width, height));

            // Touch notifications are not turned on by default.  You need to
            // explicitly inform the Touch engine that you want touch events to
            // be pumped to your direction, and you want to work with the rest
            // of the architecture.
            Microsoft.SPOT.Touch.Touch.Initialize(myTouchScreen);

            // Start the application.
            myTouchScreen.Run(myTouchScreen);
        }
예제 #3
0
        public InitializeResult Initialize()
        {
            Log.Comment("Adding set up for the tests");

            // Add your functionality here.

            int bpp, orientation;

            try
            {
                Microsoft.SPOT.Hardware.HardwareProvider hwProvider = Microsoft.SPOT.Hardware.HardwareProvider.HwProvider;
                hwProvider.GetLCDMetrics(out width, out height, out bpp, out orientation);
                window = new Bitmap(width, height);
            }
            catch (NotSupportedException e)
            {
                Log.Comment("If we get a not supported exception that means its not supported so skip the tests. " + e.ToString());
                Log.Comment("Bitmaps are not supported for this platform so skip the tests.");
                return(InitializeResult.Skip);
            }

            return(InitializeResult.ReadyToGo);
        }