张欣欣香港嫩模:请问那为使用过SetDIBitsToDevice API函数

来源:百度文库 编辑:中科新闻网 时间:2024/04/29 08:16:36
小弟不能成功使用SetDIBitsToDevice函数
希望高手跟点见解
定一如下 :

AVICAP.BITMAPINFO btm=new clientWin.AVICAP.BITMAPINFO();
btm.bmiHeader.biSize=40;
btm.bmiHeader.biBitCount = 24;
btm.bmiHeader.biWidth = 352;
btm.bmiHeader.biHeight = 288;
btm.bmiHeader.biPlanes = 1;

btm.bmiHeader.biCompression=0;
btm.bmiHeader.biSizeImage=304128;
btm.bmiHeader.biXPelsPerMeter=0;
btm.bmiHeader.biYPelsPerMeter=0;
btm.bmiHeader.biClrUsed=0;
btm.bmiHeader.biClrImportant=0;
int n=btm.bmiHeader.biWidth * btm.bmiHeader.biHeight * 3;
MemoryStream msx = new MemoryStream();
BinaryWriter bsx = new BinaryWriter(msx,Encoding.ASCII);
bsx.Write(n);
bsx.Close();
byte[] _bmpDate= msx.ToArray();
msx.Close();
AVICAP.SetDIBitsToDevice(handle,0,0,width,height,0,0,0,btm.bmiHeader.biHeight,_bmpDate,btm,0 );
就是不能显示图片