Autor Beitrag
Flamefire
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1207
Erhaltene Danke: 31

Win 10
Delphi 2009 Pro, C++ (Visual Studio)
BeitragVerfasst: Do 17.04.08 08:08 
Ich möchte eine Figur (Spielfigur, Stein...) einmal erstellen (als Grafik) und dann in einem bestimmten Winkel und auf eine bestimmte Größe skaliert zeichnen.

D.h.: Ich kann die Figur normal auf ein Canvas zeichnen (Mit LineTo etc). Die Will ich i-wie zwischenspeichern (vl das Canvas als globale Variable) und dann immer wenn ichs brauche in einer bestimmten größe (halb so groß, doppelt so groß) oder in eine bestimmte richtung gedreht (0°-360° in 1° schritten) auf ein anderes Canvas zeichnen. Dabei soll die Position der Mittelpunkt der Figur sein.

Wie machee ich das?
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Do 17.04.08 10:35 
Am besten geht das, wenn Du entweder eine Vektor-Grafik nimmst (also im Speicher alle Kurven usw. speichern) und diese einfach rotierst oder skalierst.

lternativ nimmst Du zum Speichern des Ausgangsbildes ein TBitmap, wobei Du für diesen Fall nur Verkleinerungen!!! umPowerOf2 machen solltest ...

Das Rotiert zeichenen eines TBitmaps findest Du hier im Forum Ansätze.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Flamefire Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1207
Erhaltene Danke: 31

Win 10
Delphi 2009 Pro, C++ (Visual Studio)
BeitragVerfasst: Do 17.04.08 15:31 
vektor grafik klingt gut
hab aber noch nie damit gearbeitet. hast du n stück code (z.b. einfach für ein dreieck)