有谁做过这个的东东,预览某个文件夹下所有jpg图片,
解决方案 »
- 获取那个任务管理器中最后一页的用户栏的用户信息
- TWebBrower里面的页面出问题了啊,大家帮我下
- delphi 7
- 如何得出mouse双击的时间和速度!
- 版主:这个系统有问题可以将分全给自己!!!!!快看!!!
- 救助,用wise打包BDE生成打包文件进行安装时在win98下没问题,而在WIN2000下有问题
- 关于用spcomm进行串口通讯的问题
- 如何通过SOAP来调用一个SMS的WEB服务,100大洋
- 哪有db日期构件,要求对应到数据库是8位字符
- 招兼职Delphi+Fastreport程序员,工作地杭州或上海
- 哪位会使用控件F1BOOK[在activex页第三个控件],能提供一些例子代码吗?多谢了!!
- Thttpcli控件誰有啊??
procedure TfrmMineIntroduce.LoadLeaders;
var
i, v_iRow, v_iCol, v_iCurRow, v_iCurImg:Integer;
fileCount:Integer;
begin
strList:=TstringList.Create;
fileCount:=FindAllJPGFiles;
if filecount>10 then
begin
btnimgup.Visible :=true;
btnimgdown.Visible :=true;
end;
if fileCount<>0 then //调用找JPG的函数
begin
v_iRow := Ceil(fileCount/5);
v_iCol := fileCount mod 5;
v_rowcount:=v_iRow;
v_curRowCount:=1;
v_iCurRow := 0;
v_iCurImg := 0;
while v_iCurRow <= v_iRow-1 do
begin
if (v_iCurRow = v_iRow-1) and (v_iCol<>0) then
for i := 0 to v_iCol-1 do
begin
CreateImg(v_iCurRow,i,strlist.Strings[v_iCurImg],v_iCurImg);
v_iCurImg := v_iCurImg + 1;
end
else
for i := 0 to 4 do
begin
CreateImg(v_iCurRow,i,strlist.Strings[v_iCurImg],v_iCurImg);
v_iCurImg := v_iCurImg + 1;
end;
v_iCurRow := v_iCurRow + 1;
end;
end
end;
function TfrmMineIntroduce.FindAllJPGFiles:Integer; //找到所有JPG图片名称
var
sr:TSearchRec; GetImgList:TStringList;
ImgCount:Integer;
i:Integer;
begin
if findfirst(CommonPath+'\矿区简介\领导简介\*.JPG',faAnyFile,sr)=0 then //找到第一张
begin
strList.Add(sr.name);
while findnext(sr)=0 do //继续找下一张
begin
strList.Add(sr.name);
end;
FindClose(sr);
result:=strList.count;
end
else
result:=0; {GetImgList:=TStringList.Create;
if findfirst(CommonPath+'\矿区简介\领导简介\*.JPG',faAnyFile,sr)=0 then //找到第一张
begin
GetImgList.Add(sr.name);
while findnext(sr)=0 do //继续找下一张
begin
GetImgList.Add(sr.name);
end;
FindClose(sr);
result:=GetImgList.count;
end
else
result:=0; for i:=0 to GetImgList.Count-1 do
begin
strList.Strings[strtoint(copy(GetImgList.Strings[i],1,2))-1]:=GetImgList.Strings[i];
end;}end;
procedure TfrmMineIntroduce.CreateImg(v_iRow, v_iCol:Integer;v_fsFileName:string;v_iCurImg:Integer);
var
img :TImage;
lbl : TLabel;
imgWidth, imgHeight: integer;
begin
imgWidth := 130;
imgHeight := 180;
img := TImage.Create(self);
img.Parent := ScrollBox;
img.Stretch := True;
img.Width := imgWidth;
img.Height := imgHeight;
img.Top := v_iRow * (imgHeight + 90) +60;
img.Left := v_iCol * (imgWidth + 20) + 10;
img.Picture.LoadFromFile(CommonPath+'\矿区简介\领导简介\'+v_fsFileName);
img.Tag:=v_iCurImg;
img.OnClick := ImgClick;
img.Cursor := crhandpoint;
lbl := TLabel.Create(Self);
lbl.Parent := ScrollBox;
lbl.Alignment := taCenter;
lbl.Width := imgWidth+20;
lbl.Top := img.Top + imgHeight + 10;
lbl.left := img.Left-10;
lbl.AutoSize := False;
lbl.Caption := copy(v_fsFileName,4,length(v_fsFileName)-8);
end;这是我以前做的,工程你运行不了,所以只能给你相关代码,看不懂问我。
看到你有这个函数,应该打开预览吧,虎滴小猪猪兄能给我看看这个函数不