
20.09.2009, 19:32
|
 |
Always hardcore!
|
|
Регистрация: 04.03.2009
Адрес: СПб
Сообщения: 3,239
Версия Delphi: GCC/FPC/FASM
Репутация: 62149
|
|
Цитата:
Сообщение от Страдалецъ
А в чем подвох? Для TImage два свойства выставить в истину. Proportional и Stretch.
|
Нифига подобного. Ибо сверху и снизу остаются рамки.
0nni,
Код:
procedure LoadMainBack;
var
sr:TSearchRec;
path: string;
i:integer;
dat: TStringList;
r:TRect;
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);
i:=FindFirst(path+'*.jpeg',faAnyFile xor faDirectory,sr);
while i=0 do begin
i:=FindNext(sr);
dat.Add(path+sr.Name);
end;
FindClose(sr);
i:=FindFirst(path+'*.bmp',faAnyFile xor faDirectory,sr);
while i=0 do begin
i:=FindNext(sr);
dat.Add(path+sr.Name);
end;
FindClose(sr);
frmMain.Image1.Picture.RegisterFileFormat('.jpg','JPEG Image',TJPEGImage);
frmMain.Image1.Picture.RegisterFileFormat('.jpeg','JPEG Image',TJPEGImage);
frmMain.Image1.Picture.LoadFromFile(dat[Random(dat.Count-1)]);
GetClientRect(frmMain.Handle,r);
DrawBitmaptRect(frmMain.Canvas.Handle, frmMain.Image1.Picture.Bitmap.Handle, r);
dat.Clear;
dat.Free;
end;
Не работает.
__________________
Оставайтесь хорошими людьми...
VK id2634397, ds [at] phoenix [dot] dj
|