// C# 程序
Rectangle rect = new Rectangle(Point.Empty, targetWindow.ClientSize);
using (Surface rt = device.CreateRenderTarget(rect.Width, rect.Height,
Format.X8R8G8B8, MultiSampleType.None, 0, false))
{
using (Surface backSurface = device.GetBackBuffer(0, 0, BackBufferType.Mono))
{
device.StretchRectangle(backSurface, rect, rt, rect, TextureFilter.None);
}
using (Surface surface = Device.CreateOffscreenPlainSurface(rect.Width, rect.Height,
Format.X8R8G8B8, Pool.SystemMemory))
{
device.GetRenderTargetData(rt, surface);
using (Stream stream = SurfaceLoader.SaveToStream(ImageFileFormat.Bmp, surface))
{
result = new Bitmap(stream);
}
}
}
111111
最新推荐文章于 2019-10-31 21:47:16 发布