Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi [DelphiX] DrawRotate (https://www.delphipraxis.net/40767-%5Bdelphix%5D-drawrotate.html)

Gentleman 20. Feb 2005 18:14


[DelphiX] DrawRotate
 
Hi!

Ich weiß, dieses Thema ist schon einige Male hier behandelt worden, allerdings habe ich nicht das gefunden, was ich Suche. ich hoffe ihr könnt mir bei mienem Problem weiterhelfen.

Ich drehe ein bild mit folgendem Code, in DelphiX:
Delphi-Quellcode:
DXImageList1.Items[0].DrawRotate(DXDraw1.Surface, 100, 100, 100, 50, 0, 0, 0, r);
DXDraw1.Flip;
Das Problem dabei ist, dass das Bild am Punkt (0/0) gedreht wird. Ich möchte es aber gerne genau in der Mitte drehen :freak: . Wie kann ich das anstellen?

thx im Voraus!

Oxmyx 20. Feb 2005 18:27

Re: [DelphiX] DrawRotate
 
Der erste Schritt wäre, sich mal die Parameterliste anzuschauen. Ich wette, dass zwei der drei Nuller da hinten das Drehzentrum angeben -- ohne die Funktion oder ihre Parameter zu kennen.

Gentleman 20. Feb 2005 18:42

Re: [DelphiX] DrawRotate
 
Ja da hast du recht, wenn ich dort aber andere Zahlen eintrage wird kein Bild mehr angezeigt. :roll:

JasonDX 20. Feb 2005 18:58

Re: [DelphiX] DrawRotate
 
Ich hatte auch mal das Problem
Die Funktion DrawRotate funktionierte bei mir auch nur, wenn ich das Bild um 0:0 gedreht habe
dann muss man selber die neue Koordinate für das Eck links oben berechnen (->sin & cos)

jim_raynor 20. Feb 2005 19:17

Re: [DelphiX] DrawRotate
 
Zitat:

Zitat von Chimaira
Ich hatte auch mal das Problem
Die Funktion DrawRotate funktionierte bei mir auch nur, wenn ich das Bild um 0:0 gedreht habe
dann muss man selber die neue Koordinate für das Eck links oben berechnen (->sin & cos)

Diese Parameter sind double-Werte dementsprechend ist 0.5 die Mitte :)

JasonDX 20. Feb 2005 19:47

Re: [DelphiX] DrawRotate
 
Zitat:

Zitat von jim_raynor
Zitat:

Zitat von Chimaira
Ich hatte auch mal das Problem
Die Funktion DrawRotate funktionierte bei mir auch nur, wenn ich das Bild um 0:0 gedreht habe
dann muss man selber die neue Koordinate für das Eck links oben berechnen (->sin & cos)

Diese Parameter sind double-Werte dementsprechend ist 0.5 die Mitte :)

:wall: :wall: Ich hab damals wohl doch nich alles ausprobiert :wall:

smc 26. Jul 2006 09:34

Re: [DelphiX] DrawRotate
 
hallo,

ich will nun kein neues thema deswegen aufmachen, aber kann mir jemand die definitionen von drawrotate erklären?

DXImageList1.Items[0].DrawRotate(DXDraw1.Surface, 100, 100, 100, 50, 0, 0, 0, r);

was DXDraw1.Surface bewirkt ist mir klar, aber was danach folgt ist mir unklar (besonders dieses r)

edit: hat sich erledigt

habe folgendes per google gefunden

Zitat:

Found this cool site that explains many things:
http://www.cerebral-bicycle.co.uk/viewdoc.asp?doc=37

So, here is the function details:
DrawRotate( Surface, X , Y, Width, Height, PatternIndex, CenterX, CenterY, Angle);

Surface: TDirectDrawSurface that image is drawn to, usually DXDraw.Surface.
X,Y: Draw point. Image rotates around it.
Width,Height: New width and height can be set to scale image, or set original values.
PatternIndex: Set this to 0, unless you have image-grid that has patterns for animation.
CenterX,CenterY: Defines weight-point for rotation. Normally 0.5, or in range 0..1.


Alle Zeitangaben in WEZ +1. Es ist jetzt 20:32 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