Home > 计算机与 Internet > Surface.LockRectangle()的返回值

Surface.LockRectangle()的返回值

锁定表面读获取数据(假设为A8R8G8B8,Lockable):
using(GraphicsStream gs = surface1.LockRectangle( new Rectangle( x, y, width, height), Lockflags.None )
{
  byte[] data = new byte[4*width*height];
  gs.Read(data, 0, data.Length);
}
所得结果并不是矩形区域Rectangle(x,y,width,height)内部width列height行的数据值,
而是从像素(x,y)开始,逐行顺序读取width*height个像素点。
Trick?Joke?Bug?还是我2了???
 
Advertisements
Categories: 计算机与 Internet
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: