J
JackyKen
Unregistered / Unconfirmed
GUEST, unregistred user!
C语言代码段如下:
int w,h;
unsigned char *bitsBuffer = (unsigned char *)malloc(128 * 128 * 2);
if(bitsBuffer == NULL)
return;
if (LoadYUVFromBmpFile("logo.bmp", bitsBuffer, 128 * 128 * 2, &w, &h))
{
AfxMessageBox("logo.bmp not exsit!/n"
return;
}
for( i = 0;
i < GetTotalDSPs();
i++){
SetLogo(ChannelHandle, 0, 0, w, h, (UCHAR *)bitsBuffer);
}
free(bitsBuffer);
把上面这段代码转为DELPHI代码,我转过来怎么运行错误,请各位帮帮忙,谢谢
其中用到的几个函数声明如下(从DLL中引出的):
C语言中:
int SetLogo(HANDLE hChannelHandle, int x, int y, int w, int h, unsigned char *yuv);
int LoadYUVFromBmpFile(char *FileName, unsigned char *yuv, int BufLen, int *Width, int *Height);
DELPHI中:
function SetLogo( hChannelHandle : HANDLE ;
x : integer ;
y : integer ;
w : integer ;
h : integer ;
yuv : PUCHAR) : integer;
function LoadYUVFromBmpFile( FileName : pchar ;
yuv : PUCHAR ;
BufLen : integer ;
Width : PINT ;
Height : PINT) : integer;
int w,h;
unsigned char *bitsBuffer = (unsigned char *)malloc(128 * 128 * 2);
if(bitsBuffer == NULL)
return;
if (LoadYUVFromBmpFile("logo.bmp", bitsBuffer, 128 * 128 * 2, &w, &h))
{
AfxMessageBox("logo.bmp not exsit!/n"
return;
}
for( i = 0;
i < GetTotalDSPs();
i++){
SetLogo(ChannelHandle, 0, 0, w, h, (UCHAR *)bitsBuffer);
}
free(bitsBuffer);
把上面这段代码转为DELPHI代码,我转过来怎么运行错误,请各位帮帮忙,谢谢
其中用到的几个函数声明如下(从DLL中引出的):
C语言中:
int SetLogo(HANDLE hChannelHandle, int x, int y, int w, int h, unsigned char *yuv);
int LoadYUVFromBmpFile(char *FileName, unsigned char *yuv, int BufLen, int *Width, int *Height);
DELPHI中:
function SetLogo( hChannelHandle : HANDLE ;
x : integer ;
y : integer ;
w : integer ;
h : integer ;
yuv : PUCHAR) : integer;
function LoadYUVFromBmpFile( FileName : pchar ;
yuv : PUCHAR ;
BufLen : integer ;
Width : PINT ;
Height : PINT) : integer;