Bitmap MyScreenMap_24bit = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
            Graphics g = Graphics.FromImage(MyScreenMap_24bit);
            g.CopyFromScreen(new Point(0,0),new Point(0,0),new Size(Screen.PrimaryScreen.Bounds.Width,Screen.PrimaryScreen.Bounds.Height));
            Bitmap MyScreenMap_8bit = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format8bppIndexed);
            Rectangle rect_MyscreenMap = new Rectangle(0,0,Screen.PrimaryScreen.Bounds.Width,Screen.PrimaryScreen.Bounds.Height);
            BitmapData MyscreenMap_8bitBmpData = null;
            BitmapData MyscreenMap_24bitBmpData = null;
            try
            {
                MyscreenMap_8bitBmpData = MyScreenMap_8bit.LockBits(rect_MyscreenMap, ImageLockMode.ReadOnly, MyScreenMap_8bit.PixelFormat);
                MyscreenMap_24bitBmpData = MyScreenMap_24bit.LockBits(rect_MyscreenMap, ImageLockMode.ReadOnly, MyScreenMap_24bit.PixelFormat);
                unsafe
                {
                    byte* MyScreenMap_24bitByte = (byte*)MyscreenMap_24bitBmpData.Scan0.ToPointer();
                    byte* MyScreenMap_8bitByte = (byte*)MyscreenMap_8bitBmpData.Scan0.ToPointer();
                    int stride = MyscreenMap_8bitBmpData.Stride;
                    int offset = stride-(Screen.PrimaryScreen.Bounds.Width);
                    for (int x = 0; x < (Screen.PrimaryScreen.Bounds.Height); x++)
                    {
                        for (int y = 0; y < (Screen.PrimaryScreen.Bounds.Width); y++)
                        {
                            *(MyScreenMap_8bitByte++) = *(MyScreenMap_24bitByte++);
                        }
                        MyScreenMap_8bitByte += (offset);
                    }
                }
            }
            catch (Exception MyScreenMap_Exception)
            {
                MessageBox.Show(MyScreenMap_Exception.Message);
            }
            finally
            {
                MyScreenMap_24bit.UnlockBits(MyscreenMap_24bitBmpData);
                MyScreenMap_8bit.UnlockBits(MyscreenMap_8bitBmpData);
            }
输出的图像是个很混乱的图像