首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

VC转为delphi的有关问题,

2012-03-17 
VC转为delphi的问题,急。。。在线等VC中的_open,_write,_close在delphi的对应函数是什么?fwrite(imageBuf,1,H

VC转为delphi的问题,急。。。在线等
VC中的_open,_write,_close在delphi的对应函数是什么?
fwrite(imageBuf,1,HEIGHT*WIDTH*3/2,pImageFile);


[解决办法]
OpenFile()
WriteFile()
CloseHandle()
const
HEIGHT = 16;
WIDTH = 16;

//建议你用内存流实现更方便
//具体用法用例自己搜索
var
vMemoryStream: TMemoryStream;
imageBuf: PChar;
pImageFile: string;
begin
pImageFile := 'c:\temp\temp.dat ';
vMemoryStream := TMemoryStream.Create;
GetMem(imageBuf, HEIGHT * WIDTH * 3 div 2);
try
vMemoryStream.Write(imageBuf^, HEIGHT * WIDTH * 3 div 2);
vMemoryStream.SaveToFile(pImageFile);
finally
FreeMem(imageBuf, HEIGHT * WIDTH * 3 div 2);
vMemoryStream.Free;
end;
end;
[解决办法]
学习下
[解决办法]
_open,_write,_close在delphi是有的你打开WINDOWS文件看一下

使用了以上文件写入与写出就不一定用流了.....
[解决办法]
VC中的_open,_write,_close在delphi的对应api函数,
createfile(),writefile,closefile()
[解决办法]
蹭分

热点排行