Вот, изначально говорилось - надо без рамок, можно отсекать.
Но тем не менее, даже
Код:
procedure LoadMainBack;
var
sr:TSearchRec;
path: string;
i:integer;
dat: TStringList;
r:TRect;
j: TJPEGImage;
b: TBitmap;
begin
dat:=TStringList.Create;
path:=ExtractFilePath(ParamStr(0))+'load\';
i:=FindFirst(path+'*.jpg',faAnyFile xor faDirectory,sr);
while i=0 do begin
i:=FindNext(sr);
dat.Add(path+sr.Name);
end;
FindClose(sr);
j:=TJPEGImage.Create;
j.LoadFromFile(dat[Random(dat.Count-1)]);
b:=TBitmap.Create;
b.Assign(j);
GetClientRect(frmMain.Handle,r);
DrawBitmaptRect(frmMain.Image1.Picture.Bitmap.Canvas.Handle, b.Handle, r);
dat.Clear;
dat.Free;
end;
не срабатывает. Можешь поправить?