1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
Graphics::TBitmap *bmp = new Graphics::TBitmap();
bmp->PixelFormat = pf24bits;
bmp->Width = ....; // Mettre la taille voulue
bmp->Height =....;
RGBTRIPLE *line;
for ( int y = 0; y < ....; ++y )
{
line = (RGBTRIPLE) bmp->ScanLine[y];
for ( int x = 0; x < ...; ++x )
{
line[x].rgbtRed = rand(255); // Composante rouge
line[x].rgbtGreen = rand(255); // Composante verte
line[x].rgbtBlue = rand(255); // Composante bleue
}
}
// Plus qu'à dessiner le bmp sur le composant voulu.... |