public Form1()
        {
            InitializeComponent();            this.TransparencyKey = Color.White;            panel1.BackColor = Color.White;
        }          //用于截取panel1内图像的函数
        private void printScreen()
        {
            Graphics g = Graphics.FromImage(image);            Point panelLocation = new Point(0, 0);
            panelLocation = panel1.PointToScreen(panelLocation);  //PointToScreen——控件相对屏幕的相对坐标            //panelLocation.X\Y是panel1控件相对屏幕的位置;0、0是从image的(0,0)点开始画图
            g.CopyFromScreen(panelLocation.X, panelLocation.Y, 0, 0, new Size(240, 320));
            pictureBox1.Image = image2;            
        }        private void loadBmp()
        {
            System.Drawing.Imaging.BitmapData imageData = image.LockBits(rect, System.Drawing.Imaging.ImageLockMode.ReadWrite, System.Drawing.Imaging.PixelFormat.Format32bppRgb);            //Get the address of the first line
            IntPtr ptr = imageData.Scan0;            // Copy the RGB values into the array.
            System.Runtime.InteropServices.Marshal.Copy(ptr, rgbValues, 0, bytes);            image.UnlockBits(imageData);
        }
        private void printBmp()
        {
            System.Drawing.Imaging.BitmapData image2Data = image2.LockBits(rect, System.Drawing.Imaging.ImageLockMode.ReadWrite, System.Drawing.Imaging.PixelFormat.Format32bppRgb);            IntPtr ptr2 = image2Data.Scan0;            //将数组里的数据重新装入到image2
            System.Runtime.InteropServices.Marshal.Copy(rgbValues, 0, ptr2, bytes);            image2.UnlockBits(image2Data);
        }
就是这样的,把panel设置成透明的,然后在panel的区域截图,放到picturebox里面,但是有白色的部分,到picturebox里的时候都变成透明的了,不知道怎么回事儿。下面是这种情况的截图。http://photo.163.com/caterpillar12345/big/#aid=64077707&id=6649663826麻烦高手给指教