Beispiel #1
0
        public void CopyToBitmap(Rectangle imageArea, IntPtr bitmap, int bitmapStride)
        {
            NativeBitmapSourceParameterValidation.CopyToBitmap(this, imageArea, bitmap, bitmapStride, out _);

            using (X11Bitmap xBitmap = X11Bitmap.Create(Display, Visual, imageArea.Width, imageArea.Height))
            {
                LibX11.XGetSubImage(
                    Display,
                    PixmapId,
                    imageArea.X,
                    imageArea.Y,
                    (uint)imageArea.Width,
                    (uint)imageArea.Height,
                    ulong.MaxValue,
                    XImageFormat.ZPixmap,
                    xBitmap.XImage,
                    0,
                    0
                    );

                PixelConverter.Convert_PARGB_32_To_ARGB_32(xBitmap.ImageData, imageArea.Width * 4, bitmap, bitmapStride, imageArea.Width, imageArea.Height);
            }
        }