S
songyp
Unregistered / Unconfirmed
GUEST, unregistred user!
[]下面的程序是用c++写的,它的功能是将图像给扫描到内存中,我如何把下面的程序改
成delphi的并且存成一个文件
成delphi的并且存成一个文件
代码:
int nline = 100; // number of line in one scan buffer
HGLOBAL hBuf = GlobalAlloc(GMEM_FIXED, lLineByte* nline);
LPBYTE lpBuf = NULL;
if(hBuf) lpBuf = (LPBYTE)GlobalLock(hBuf);
else return;
// start to get image from scanner
// check if the total lines are reaching our desired number and
// check if the return lines are zero, if SS_Scan return zero,it
// means the scanning is finished or error occurs
int nScanLine;
int nTotalLine=0;
while(nTotalLine < BIH.biHeight && (nScanLine = SS_Scan(lpBuf, nline))) {
// ToDo: save image here for lpBuf, or move image to user's buf from lpBuf
nTotalLine+=nScanLine;
}