在切割的时候,我明明选中了一个区域,可是出来的结果却是与之上下相对应的另一个区域,
如图:
11111 22222 3333344444 55555 66666
-------
77777 |88888 |99999
| |
11111 |22222 |33333
-------
可出来的结果却是:
2222255555
这是为什么啊?还不是完全的相反,起码22222和55555还是原来的顺序。
如图:
11111 22222 3333344444 55555 66666
-------
77777 |88888 |99999
| |
11111 |22222 |33333
-------
可出来的结果却是:
2222255555
这是为什么啊?还不是完全的相反,起码22222和55555还是原来的顺序。
public AImage Apply(AImage vin_Image)
{
AImage vout_Image=new AImage ();if( ( rect.Left > 0 )&&
( rect.Top > 0 )&&
( rect.Right <= vin_Image.Width )&&
( rect.Bottom <= vin_Image.Height )&&
( rect.Left <= rect.Right )&&
( rect.Top <= rect.Bottom ) )
{
vout_Image.Width =rect.Width ;
vout_Image.Height =rect.Height ;
vout_Image.BitsPerPixel =1;
vout_Image.PixelInfo =new pointcolor [vout_Image.Width *vout_Image.Height ];
}
int out_wy,out_wx,in_wx,in_wy;for(out_wy = 0; out_wy < vout_Image.Height ; out_wy++ )
{
in_wy = out_wy + rect.Top ;
if( in_wy >= vin_Image.Height ) break;for( out_wx = 0; out_wx < vout_Image.Width ; out_wx++ )
{
in_wx = out_wx + rect.Left ;
if( in_wx >= vin_Image.Width ) break;vout_Image.PixelInfo [out_wy * vout_Image.Width + out_wx].Mono
= vin_Image.PixelInfo [in_wy * vin_Image.Width + in_wx].Mono ;
}
}
return vout_Image;
}
所以需要用ymax减去对应的矩形坐标y分量后再提取