1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
// tu enregistrera avant tout les chemins de tes images dans une listbox
// puis tu appel cette fonction
// nb_image == listbox->Items->count.
void TForm1::AFFICHE_IMAGE(int nbimage)
{
int x,y;
x=y=0;
Cases *tab[nbimage];
for (int i=0; i<nbimage; i++)
{
tab[i]= new Cases(Form1->ScrollBox1);
// mise en forme à ma guise ( 6 par ligne )
if(!fmodl(i,3)) x=0; else x++;
tab[i]->Left += ( 70 * x );
if(!fmodl(i,3)) y++;
tab[i]->Top += ( 70 * y );
//ex : list->items->string[i]
tab[i]->Picture->LoadFromFile( "chemin de ton image ");
tab[i]->Invalidate();
}
}
} |