关于MemoryStream
如下面的程序,就是截图,然后保存到流,但是不论我截的是什么图,ms里面的值都一样,请高人指点,我实在不知道哪里错了
MemoryStream ms = new MemoryStream();
Rectangle SelectionRectangle = new Rectangle(0, 0, 500, 500);
using (Bitmap bitmap = new Bitmap(SelectionRectangle.Width,SelectionRectangle.Height))
{
using (Graphics g = Graphics.FromImage(bitmap))
{
g.CopyFromScreen(new Point(0,0), new Point(0,0),
SelectionRectangle.Size);
}
bitmap.Save(ms, ImageFormat.Bmp);
bitmap.Dispose();
}