![]() |
Suche Funktion: Bitmap um 90° drehen
Hallo, ich hab schon im Forum gesucht, aber keine Funktion dafür gefunden..
Kann mir irgendjemand eine Funktion geben, mit der ich ein TBitmap (möglichst schnell) um 90° drehen kann? Danke und Frohe Weihnachten! :-D |
Re: Suche Funktion: Bitmap um 90° drehen
|
Re: Suche Funktion: Bitmap um 90° drehen
|
Re: Suche Funktion: Bitmap um 90° drehen
Noch ein Problem...
Ich nehm jetzt diese Prozedur hier:
Delphi-Quellcode:
Aber in welcher Unit stehen BitBlt,SRCCOPY,PlgBlt?
TRotateValue = (rv0, rvR90, rvR180, rvR270, rvL90, rvL180, rvL270);
[...] procedure RotatePic(ASource: TBitmap; ADest: TBitmap; ADirection: TRotateValue); var LPoints: array[0..2] of TPoint; LDest: TBitmap; begin if (ADirection = rv0) and (ASource = ADest) then exit else begin LDest := TBitmap.Create; if ADirection in [rv0, rvL180, rvR180] then begin LDest.Width := ASource.Width; LDest.Height := ASource.Height; end else begin LDest.Width := ASource.Height; LDest.Height := ASource.Width; end; if ADirection = rv0 then begin BitBlt(LDest.Canvas.Handle, 0, 0, ASource.Width, ASource.Height, ASource.Canvas.Handle, 0, 0, SRCCOPY); end else begin if (ADirection = rvL90) or (ADirection = rvR270) then begin LPoints[0].X := 0; LPoints[0].Y := ASource.Width; LPoints[1].X := 0; LPoints[1].Y := 0; LPoints[2].X := ASource.Height; LPoints[2].Y := ASource.Width; end; if (ADirection = rvR90) or (ADirection = rvL270) then begin LPoints[0].X := ASource.Height; LPoints[0].Y := 0; LPoints[1].X := ASource.Height; LPoints[1].Y := ASource.Width; LPoints[2].X := 0; LPoints[2].Y := 0; end; if (ADirection = rvR180) or (ADirection = rvL180) then begin LPoints[0].X := ASource.Width - 1; LPoints[0].Y := ASource.Height - 1; LPoints[1].X := -1; LPoints[1].Y := ASource.Height - 1; LPoints[2].X := ASource.Width - 1; LPoints[2].Y := -1; end; PlgBlt(LDest.Canvas.Handle, LPoints, ASource.Canvas.Handle, 0, 0, ASource.Width, ASource.Height, 0, 0, 0); end; ADest.Assign(LDest); LDest.Free; end; |
Re: Suche Funktion: Bitmap um 90° drehen
Moin!
Zitat:
MfG Muetze1 |
Alle Zeitangaben in WEZ +1. Es ist jetzt 08:30 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz