c++智能机器人问答系统设计
发布网友
发布时间:2022-04-26 07:07
我来回答
共2个回答
热心网友
时间:2022-06-25 02:11
BOOL CALLBACK exBeginCapture(HANDLE hBoard)
{
short width,height;
long form;
if (bDispToScreen)
{
bufform=exGetTargetSize(hBoard, BUFFER, &width, &height);
form=okSetCaptureParam(hBoard,CAPTURE_SCRRGBFORMAT,GETCURRPARAM); //-1
{ //treat rotate
short temp;
temp=(short)okSetConvertParam(hBoard,CONVERT_UPRIGHT,-1); //un
if(temp>0) {
temp=width;
width=height;
height=temp;
}
}
exSetBitmapHeader(lpbi, width, height, HIWORD(form), LOWORD(form) );
if (bDispToScreen > 1)
{ //take same bits as screen for callback exSetToScreen
if (bDispToScreen == 3)
{ //make pseudo-display
inti;
#defineway1
#ifdefway1
//way1 by convert
{
PALETTEENTRY palPalEntry[256];
exSetBitmapHeader(lpbi, width, height, HIWORD(form), LOWORD(form) );
//just exam to set palette to yellow
for (i = 0; i<256; i++ ) {
palPalEntry[i].peRed = (BYTE)i;
palPalEntry[i].peGreen = (BYTE)i;
palPalEntry[i].peBlue = (BYTE)0;
palPalEntry[i].peFlags = 0;
}
//if( LOWORD(blkform)!=FORM_GRAY8) ////set mapping palette
okSetConvertParam(hBoard, CONVERT_PALETTE, (LPARAM)palPalEntry);
}
#else
//way2 by windows palette
{
RGBQUAD*lpRGB = (RGBQUAD *)((LPSTR)lpbi + lpbi->biSize);
for (i = 0; i<256; i++ )
{
lpRGB[i].rgbRed = (BYTE)i;
lpRGB[i].rgbGreen = (BYTE)i;
lpRGB[i].rgbBlue = (BYTE)0;
lpRGB[i].rgbReserved = 0;
}
}
#endif
}
}
}
blk.lpBits = (LPBYTE)lpdib;
blk.iBitCount = lpbi->biBitCount;
if (bMakeMirror & 1) //x mirror
blk.iWidth = -(short)lpbi->biWidth;
else
blk.iWidth = (short)lpbi->biWidth;
if (okSetCaptureParam(hBoard, CAPTURE_SAMPLEFIELD, -1) == 0) //sample in field by field
if (LOWORD(okSetVideoParam(hBoard, VIDEO_SIGNALTYPE, -1)) == 1) //interlace video
if (okSetConvertParam(hBoard, CONVERT_FIELDEXTEND, -1) != 0)
lpbi->biHeight *= 2; //double size for ht
if(bMakeMirror & 2) //y mirror
blk.iHeight = (short)lpbi->biHeight; // y mirror
else
blk.iHeight = -(short)lpbi->biHeight; //note: minus is for invert dib in y by ConvertRect
elapsed = GetTickCount();
numframe = 0;
return 1;
}
热心网友
时间:2022-06-25 02:12
网上应该有图灵机的开源代码吧,搜搜呗