H
hehuan
Unregistered / Unconfirmed
GUEST, unregistred user!
关于字符与地址转换:
这是Usb摄像头拍照的代码,非常好用:
SendMessage(hWndC,
WM_CAP_SAVEDIB,
0,
longint(pchar(SaveDialog1.FileName)));
或者
SendMessage(hWndC,
WM_CAP_SAVEDIB,
0,
longint(pchar('c:/111.bmp')));
但问题是,我不想生成临时bmp文件,而是直接存入TMemoryStream,然后直接存到数据库里去,但是试了很多次都不行:
photoStream : TMemoryStream;
photoStream := TMemoryStream.create;
photoStream.Position:=0;
SendMessage(hWndC,
WM_CAP_SAVEDIB,
0,
longint(pchar(photoStream.Position)));
或者
SendMessage(hWndC,
WM_CAP_SAVEDIB,
0,
longint((@photoStream.Position)));
也不行。
还请各位大大出手相助,非常感谢!
这是Usb摄像头拍照的代码,非常好用:
SendMessage(hWndC,
WM_CAP_SAVEDIB,
0,
longint(pchar(SaveDialog1.FileName)));
或者
SendMessage(hWndC,
WM_CAP_SAVEDIB,
0,
longint(pchar('c:/111.bmp')));
但问题是,我不想生成临时bmp文件,而是直接存入TMemoryStream,然后直接存到数据库里去,但是试了很多次都不行:
photoStream : TMemoryStream;
photoStream := TMemoryStream.create;
photoStream.Position:=0;
SendMessage(hWndC,
WM_CAP_SAVEDIB,
0,
longint(pchar(photoStream.Position)));
或者
SendMessage(hWndC,
WM_CAP_SAVEDIB,
0,
longint((@photoStream.Position)));
也不行。
还请各位大大出手相助,非常感谢!