Esempio n. 1
0
        public static void Main()
        {
            LCD myApplication = new LCD();

            Window mainWindow = myApplication.CreateWindow();

            // Start the application
            //myApplication.Run(mainWindow);

            Bitmap bitmap1 = new Bitmap(SystemMetrics.ScreenWidth, SystemMetrics.ScreenHeight);
            Bitmap bitmap2 = new Bitmap(SystemMetrics.ScreenWidth, SystemMetrics.ScreenHeight);

            int ox = 0;
            int oy = 0;
            int rx = bitmap1.Width;
            int ry = bitmap1.Height;
            int sd = 0;

            if (rx < ry)
            {
                sd = rx;
            }
            else
            {
                sd = ry;
            }


            //
            // Draw Diagonals
            //
            bitmap1.DrawLine(Colors.Blue, 3, 0, 0, rx, ry);
            bitmap1.DrawLine(Colors.Blue, 3, rx, 0, 0, ry);

            bitmap2.DrawLine(Colors.Red, 3, 0, 0, rx, ry);
            bitmap2.DrawLine(Colors.Red, 3, rx, 0, 0, ry);


            for (int ioff = 0; ioff < sd; ioff += 10)
            {
                int oX = ox + ioff;
                int oY = oy + ioff;
                int wX = rx - 2 * ioff;
                int wY = ry - 2 * ioff;
                bitmap1.DrawRectangle(Colors.White, 1, oX, oY, wX, wY, 1, 1,
                                      Colors.Green, ox, oy, Colors.Green, rx, ry, 0xFF);
                bitmap2.DrawEllipse(Colors.White, rx / 2, ry / 2, wX, wY);
            }



            while (true)
            {
                bitmap1.Flush();
                Thread.Sleep(250);
                bitmap2.Flush();
                Thread.Sleep(200);
            }
        }
Esempio n. 2
0
        public static void Main()
        {
            LCD myApplication = new LCD();

            Window mainWindow = myApplication.CreateWindow();
            
            // Start the application
            //myApplication.Run(mainWindow);

            Bitmap bitmap1 = new Bitmap(SystemMetrics.ScreenWidth,SystemMetrics.ScreenHeight);
            Bitmap bitmap2 = new Bitmap(SystemMetrics.ScreenWidth, SystemMetrics.ScreenHeight);

            int ox = 0;
            int oy = 0;
            int rx = bitmap1.Width;
            int ry = bitmap1.Height;
            int sd=0;
            if (rx < ry)
                sd = rx;
            else
                sd = ry;


	    //
	    // Draw Diagonals
	    //
            bitmap1.DrawLine(Colors.Blue, 3, 0, 0, rx, ry);
            bitmap1.DrawLine(Colors.Blue, 3, rx, 0, 0, ry);

            bitmap2.DrawLine(Colors.Red, 3, 0, 0, rx, ry);
            bitmap2.DrawLine(Colors.Red, 3, rx, 0, 0, ry);


            for(int ioff=0; ioff < sd; ioff += 10)
	    {
		int oX  = ox+ioff;
		int oY  = oy+ioff;
		int wX  = rx - 2*ioff;
		int wY  = ry - 2*ioff;
                bitmap1.DrawRectangle(Colors.White, 1, oX, oY, wX, wY, 1, 1, 
                    Colors.Green, ox, oy, Colors.Green, rx, ry, 0xFF);
                bitmap2.DrawEllipse(Colors.White, rx/2, ry/2, wX, wY);
	    }

            


            while (true)
            {
                bitmap1.Flush();
                Thread.Sleep(250);
                bitmap2.Flush();
                Thread.Sleep(200);
            }

        }