Ejemplo n.º 1
0
        } // End Sub PerformanceTest

        public static void TestX11_Simple()
        {
            System.IntPtr display = LibX11Functions.XOpenDisplay(System.IntPtr.Zero);

            int defaultScreen = LibX11Functions.XDefaultScreen(display);

            System.UIntPtr window = LibX11Functions.XRootWindow(display, defaultScreen);

            int screen_width  = LibX11Functions.DisplayWidth(display, defaultScreen);
            int screen_height = LibX11Functions.DisplayHeight(display, defaultScreen);

            XWindowAttributes xa = new XWindowAttributes();

            LibX11Functions.XGetWindowAttributes(display, window, ref xa);
            System.Console.WriteLine(xa.width);
            System.Console.WriteLine(xa.height);

            int AllPlanes = ~0;

            System.UIntPtr AllPlanes2 = new System.UIntPtr((uint)AllPlanes);

            /*
             * XImage* img = LibX11Functions.XGetImage2(display, window, 0, 0, (uint) xa.width, (uint)xa.height
             *  , AllPlanes2, LinScreen.ZPixmap);
             */


            // System.IntPtr image = LibX11Functions.XGetImage(display, window, 0, 0, (uint) xa.width, (uint)xa.height
            //     , AllPlanes2, LinScreen.ZPixmap);

            SafeX11.SlowScreenshot(display, window, 0, 0, (uint)xa.width, (uint)xa.height
                                   , AllPlanes2, LinScreen.ZPixmap, true);


            // XImage img = System.Runtime.InteropServices.Marshal.PtrToStructure<XImage>(image);


            // System.Console.WriteLine(img.bitmap_bit_order);
            // System.Console.WriteLine(img.bits_per_pixel);
            // System.Console.WriteLine(img.width);
            // System.Console.WriteLine(img.height);
            // System.Console.WriteLine(img.data);

            // // // // // //

            // System.Console.WriteLine(img->bitmap_bit_order);
            // System.Console.WriteLine(img->width);
            // System.Console.WriteLine(img->height);
            // System.Console.WriteLine(img->data);

            // rtaNetworking.Linux.tt.foo();

            // LibX11Functions.XDestroyImage2(img);


            LibX11Functions.XCloseDisplay(display);
        }
Ejemplo n.º 2
0
 public static void TestX11_Shared()
 {
     System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
     for (int i = 0; i < 100; ++i)
     {
         sw.Start();
         // System.Console.WriteLine(System.DateTime.Now.ToString("dd:MM:yyyy HH:mm:ss.fff"));
         byte[] res = SafeX11.X11Screenshot(true);
         sw.Stop();
         System.Console.WriteLine(sw.ElapsedMilliseconds);
         sw.Reset();
     } // Next i
 }     // End Sub TestX11_Shared