Exemple #1
0
        public static X11Image Create(IntPtr display, IntPtr visual, ulong drawable, int width, int height)
        {
            if (width < 0 || height < 0)
            {
                throw new ArgumentException($"Image dimensions cannot be negative ({width} x {height}).");
            }

            // todo: handle zero width / height

            ulong pixmapId = LibX11.XCreatePixmap(
                display,
                drawable,
                (uint)width,
                (uint)height,
                X11Application.RequiredColorDepth
                );

            return(new X11Image(display, visual, pixmapId, width, height));
        }