我通过存储过程实现过,但是由于水平有限,没有达到这种效果,附上部分代码<br>procedure TForm1.FormCreate(Sender: TObject);<br>var ii,iii:integer;<br> d,j:integer;<br> jpg:TJPEGImage;<br> stream:TMemorystream;<br>begin<br>pcount:=0;<br>combobox1.ItemIndex:=1;<br>scrolldel;<br> i := i;<br> sp.ProcedureName := 'Pr_PageShowOne;1';<br> sp.Close;<br> sp.Parameters.ParamByName('@PageSize').Value :=8;<br> sp.Parameters.ParamByName('@PageCurrent').Value := i;<br> sp.Parameters.ParamByName('@FdName').Value := 'pictureid';<br> sp.Parameters.ParamByName('@SelectStr').Value := 'pictureid,title,picsmall,categoryname,picturedate,uploaddate,remark';<br> sp.Parameters.ParamByName('@FromStr').Value := 'pictures';<br> sp.Parameters.ParamByName('@WhereStr').Value := '';<br> sp.Parameters.ParamByName('@OrderByStr').Value := 'pictureid';<br> sp.Open;<br> Label1.Caption := '记录总数:'+IntToStr(sp.Parameters.ParamValues['@CountRows']);<br> Label2.Caption := '总页数:'+IntToStr(sp.Parameters.ParamValues['@CountPage']);<br> RsCount := sp.Parameters.ParamValues['@CountPage'];<br> Label3.Caption := '第 '+IntToStr(i)+ ' 页';<br><br> d:=sp.RecordCount;<br> j:=d;<br> //调用拷贝图片显示<br> while d>0 do<br> begin<br> image[j-d]:=Timage.Create(application.Owner);<br> labelx[j-d]:=Tlabel.Create(self);<br> pan[j-d]:=Tpanel.Create(self);<br> pan[j-d].Parent:=scrollbox1;<br> image[j-d].Parent:=pan[j-d];<br> labelx[j-d].Parent:=pan[j-d];<br> pan[j-d].Top:=150*((j-d)div 8)+10;<br> pan[j-d].Left:=120*((j-d)mod 8)+10;<br> image[j-d].Top:=2;<br> image[j-d].Left:=2;<br> image[j-d].Height:=115;<br> pan[j-d].Height:=130;<br> pan[j-d].Width:=110;<br> labelx[j-d].Top:=image[j-d].Height+2;<br> image[j-d].Width:=105;<br> labelx[j-d].Left:=2;<br> stream:=Tmemorystream.Create;<br> TBlobField(sp.FieldByName('picsmall')).SaveToStream(stream);<br> Stream.Position:=0;<br> jpg:=TJPEGImage.Create;<br> try<br> jpg.LoadFromStream(stream);<br> imageh[j-d]:=jpg.height;<br> imagew[j-d]:=jpg.width;<br> image[j-d].Stretch:=true;<br> //image1.Left:=0;<br> //image1.Top:=0;<br> image[j-d].Picture.Assign(jpg);<br> labelx[j-d].Caption:=sp.fieldbyname('title').AsString;<br> labelx[j-d].Font.Color:=clblue;<br> image[j-d].BringToFront;<br> labelx[j-d].BringToFront;<br> image[j-d].Visible:=true;<br> labelx[j-d].Visible:=true;<br> pcount:=pcount+1;<br> finally<br> jpg.Free;<br> end;<br> sp.next;<br> d:=d-1;<br> end;<br> iii:=sp.Parameters.ParamValues['@CountPage'];<br> for ii := 1 to iii do<br>combobox1.Items.Add(IntToStr(ii));<br>next;<br><br>end;<br>用这种方法能显示图片,但是不知道将表里的字段全部用标签显示出来,谁有好的代码将发到我的邮箱,万分感谢,我的邮箱是wdbcpw@163.com