Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi Suche Funktion: Bitmap um 90° drehen (https://www.delphipraxis.net/36821-suche-funktion-bitmap-um-90%B0-drehen.html)

axelf98 26. Dez 2004 14:11


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

supermuckl 26. Dez 2004 14:15

Re: Suche Funktion: Bitmap um 90° drehen
 
dann haste nich richtig gesucht

http://www.delphipraxis.net/internal...=canvas+drehen

dizzy 26. Dez 2004 14:15

Re: Suche Funktion: Bitmap um 90° drehen
 
Graphics32-Lib 8)

axelf98 26. Dez 2004 15:15

Re: Suche Funktion: Bitmap um 90° drehen
 
Noch ein Problem...
Ich nehm jetzt diese Prozedur hier:

Delphi-Quellcode:
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;
Aber in welcher Unit stehen BitBlt,SRCCOPY,PlgBlt?

Muetze1 26. Dez 2004 17:26

Re: Suche Funktion: Bitmap um 90° drehen
 
Moin!

Zitat:

Zitat von axelf98
Aber in welcher Unit stehen BitBlt,SRCCOPY,PlgBlt?

Windows?

MfG
Muetze1


Alle Zeitangaben in WEZ +1. Es ist jetzt 14:56 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz