При чтении из файла:
res:=openresource(s);
while temp<>'###' do begin
if temp<>'' then begin
if copy(temp,0,1)<>'^' then text:=text+temp+chr(13) else begin
if text<>'' then h:=format(text,0);
if text<>'' then im[c+1]:=h;
ig[c+1]:=stringtointeger(copy(temp,1,length(temp)));
img[ig[c+1]]:=loadimage('/'+ig[c+1]+'.png');
h:=trunc(getimageheight(img[stringtointeger(copy(temp,1,length(temp)))])/textheight);
for d:=0 to h+1 do ot:=ot+chr(13);
text:=text+ot;
ot:='';
c:=c+1;
end;
end;
temp:=win2utf(readline(res));
end;
temp:=win2utf(readline(res));
if temp<>'NULL' then lnk:=true else lnk:=false;
closeresource(res);
h:=format(text,0);
Потом при отрисовке:
for d:=1 to c do
drawimage(img[ig[d]],10,sz-getposition+im[d]);
drawtextwindow;
Честно говоря понять свой старый код до конца даже я сам не в силах, но идея в принципе видна, что уже хорошо))