public Form1()
{
InitializeComponent();
imageList1 = new ImageList () ;
// The default image size is 16 x 16, which sets up a larger
// image size.
imageList1.ImageSize = new Size(255,255);
imageList1.TransparentColor = Color.White;
// Assigns the graphics object to use in the draw options.
myGraphics = Graphics.FromHwnd(panel1.Handle);
}
提供一个想法.首先从DB中按照路径及ID号分别提出,用IMAGE对象的FORMFILE方法得到图像,至于数量可以用数据库中的COUNT得到,用FOR循环插入到IMAGE数组对象中
EX:
private imgACD() as new image
for i=0 to colcount
____
imgacd(i).fromfile(********)
___
next
(*****:为从数据库中得到路径,所以要在FOR循环中得到数据集,插入到IMAGE数组对象之后,再用NEXT方法得到下一条数据集.
然后再将得到的IMAGE数组对象插入到Controls中,使用它的ADD方法,至于布局可以用ANCHOR,DOCK,DOCKPADDING,LOCATION等方法来调整.