Hallo Zusammen, ich möchte ein Bild in 90° egal wie herum rotierne. Möchte mit volgender routine arbeiten:
int *ptr;
int w = Image1->Height;
Graphics::TBitmap *pBitmap = new Graphics::TBitmap();
pBitmap->Height = Image1->Width;
pBitmap->Width = Image1->Height;
pBitmap->PixelFormat = pf32bit;
Image1->Picture->Bitmap->PixelFormat = pf32bit;
for( int i = 0; i < Image1->Height; i++)
{
ptr = (int*)Image1->Picture->Bitmap->ScanLine[i];
for(int y = 0; y < w; y ++)
{
pBitmap->Canvas->Pixels[i][w-y] = TColor(ptr[y]);
}
}
Image1->Picture->Assign(pBitmap);
Image1->Center = true;
Meiner meinung nach, alles logisch. Aber folgendes Problem: Die Bilder werden zwar gedreht, aber verfärbt in Blau und unskalliert auf Image1.
Kann mir jemand einen TIPP geben?
Gruß
Tolga
int *ptr;
int w = Image1->Height;
Graphics::TBitmap *pBitmap = new Graphics::TBitmap();
pBitmap->Height = Image1->Width;
pBitmap->Width = Image1->Height;
pBitmap->PixelFormat = pf32bit;
Image1->Picture->Bitmap->PixelFormat = pf32bit;
for( int i = 0; i < Image1->Height; i++)
{
ptr = (int*)Image1->Picture->Bitmap->ScanLine[i];
for(int y = 0; y < w; y ++)
{
pBitmap->Canvas->Pixels[i][w-y] = TColor(ptr[y]);
}
}
Image1->Picture->Assign(pBitmap);
Image1->Center = true;
Meiner meinung nach, alles logisch. Aber folgendes Problem: Die Bilder werden zwar gedreht, aber verfärbt in Blau und unskalliert auf Image1.
Kann mir jemand einen TIPP geben?
Gruß
Tolga
Comment