PictureControl とかがあって、じゃあ置いておけばあとで そのまま読んでくれとかファイル名を渡す、そういう形式だと思っておりました。
C# だとかそうですよね。
ところが FileRead() だと 32KB しか読まないらしいわけです。手元の情報だとそれだけしかないんですが、どこか見てるところが間違えてるんでしょうか。
…
まあいいんですが、バッファが必要なら書くまでです。
こんな感じで書くと画像ファイルが読み込めます。blob で読み込んで渡してやれば表示してくれます。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
integer fp, err | |
blob buf, b | |
long flen | |
string filename | |
int loops, i | |
string pathname | |
int result | |
result = getFileOpenName("Open image file", pathname, filename, "BMP", "BMP Files (*.BMP),*.BMP,") | |
if result=1 then | |
flen=fileLength(pathname) | |
fp = fileOpen(pathname, StreamMode!, Read!, Shared!) | |
if fp<>-1 then | |
if 32765 < flen then | |
if Mod(flen,32765)=0 then | |
loops=flen/32765 | |
else | |
loops=(flen/32765)+1; | |
end if | |
else | |
loops=1 | |
end if | |
for i=1 to loops | |
err=fileRead(fp,b) | |
buf=buf+b | |
next | |
p_1.SetPicture(buf) | |
end if | |
fileClose(fp) | |
end if | |