Images drehen / Animation

So ich hoffe der Code-Schnippsel kann die vielleicht ein paar Denkanstöße geben. ;)

//Open the source and create the destination bitmap
Graphics::TBitmap *SrcBitmap=new Graphics::TBitmap;
Graphics::TBitmap *DestBitmap=new Graphics::TBitmap;
SrcBitmap->LoadFromFile("YourBitmap.bmp");

//rotate by 90°

DestBitmap->Width=SrcBitmap->Height;
DestBitmap->Height=SrcBitmap->Width;

//Rotate one pixel at a time
for (int x=0;x<SrcBitmap->Width;x++)
{
for(int y=0;y<SrcBitmap->Height;y++)
{
DestBitmap->Canvas->Pixels[y][SrcBitmap->Width-1-x]=
SrcBitmap->Canvas->Pixels[x][y];
}
}

//Assign the Destination bitmap to a TImage
Image1->Picture->Bitmap=DestBitmap;
delete DestBitmap;
delete SrcBitmap;

Have Fun !
 
jo danke hilft mir weiter...auch wenns recht kompliziert ausschaut...*g*
kann man Bilder nur in 90°-Schritten drehen oder gehts auch mit anderen Winkeln?
 
Zurück