0
抱歉发送垃圾邮件的问题,但有没有从窗口(不是项目窗口)在XNA中加载像素的快速方法?我需要加载100像素宽度100像素高度,没有太多滞后。 (也许每10秒更新一次)。C#XNA快速像素加载
public void UpdateMap()
{
for (int y = 100; y < 120; y++)
{
for (int x = 1500; x < 1510; x++)
{
uint pixel = GetPixel(hdc, x, y);
colorlist.Add(new Color((int)(pixel & 0x000000FF),
(int)(pixel & 0x0000FF00) >> 8,
(int)(pixel & 0x00FF0000) >> 16));
}
}
}