type TMyhelp = array[0..0] of TRGBQuad;
//
procedure BitmapDrehen_90Grad(const Bitmap: TBitmap);
var P: PRGBQuad;
x,y,b,h : Integer;
RowOut: ^TMyHelp;
help: TBitmap;
begin
Bitmap.PixelFormat := pf32bit;
help := TBitmap.Create;
try
help.PixelFormat := pf32bit;
b := bitmap.Height;
h := bitmap.Width;
help.Width := b;
help.height := h;
for y := 0 to (h-1) do
begin
rowOut := help.ScanLine[y];
P := Bitmap.scanline[bitmap.height-1];
inc(p,y);
for x := 0 to (b-1) do
begin
rowout[x] := p^;
inc(p,h);
end;
end;
finally
bitmap.Assign(help);
end;
end;
Beispiel :
procedure TForm1.Button1Click(Sender: TObject);
begin
BitmapDrehen_90Grad(Image1.Picture.Bitmap);
end;
Keine Kommentare:
Kommentar veröffentlichen