請教如何將bcb 轉 delphi |
尚未結案
|
chingrenn
一般會員 發表:10 回覆:13 積分:4 註冊:2003-03-04 發送簡訊給我 |
|
wyndog
資深會員 發表:7 回覆:362 積分:348 註冊:2004-10-12 發送簡訊給我 |
var // 例中的 char 其實都是當 byte 用,所以我翻成 byte buffer: array [0..255] of Byte; iWidthByte, iHeightDot, x, y: integer; ptr: ^Byte; ch: Byte; begin ....... for y := 0 to iHeightDot - 1 do begin ptr := Image1.Picture.Bitmap.ScanLine[y]; for x := 0 to iWidthByte - 1 do begin ch := not Ptr^; Inc(Ptr); sendbuf(@ ch, 1); end; end; ....... end;單純的翻譯,細節請自行留意 |
chingrenn
一般會員 發表:10 回覆:13 積分:4 註冊:2003-03-04 發送簡訊給我 |
void _stdcall sendbuf(char command[], int len);
當 sendbuf 於delphi 該如何宣告
若是宣告成
procedure sendbuf(command : byte; len : integer);
則
sendbuf(@ ch, 1); 出現byte and pointer 型態不符
煩請大發慈悲吧! var
// 例中的 char 其實都是當 byte 用,所以我翻成 byte
buffer: array [0..255] of Byte;
iWidthByte, iHeightDot, x, y: integer;
ptr: ^Byte;
ch: Byte;
begin
.......
for y := 0 to iHeightDot - 1 do begin
ptr := Image1.Picture.Bitmap.ScanLine[y];
for x := 0 to iWidthByte - 1 do begin
ch := not Ptr^;
Inc(Ptr);
sendbuf(@ ch, 1);
end;
end;
.......
end;
|
wyndog
資深會員 發表:7 回覆:362 積分:348 註冊:2004-10-12 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |