Autor Beitrag
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: So 30.03.03 21:44 
Hi Leutz,
Ich komm gleich zumeinem Prob´:
Ich möchte ein Bild (aber NICHT ausschließlich Bmp´s) an die Größe eines TImage anpassen, aber die Größenverhältnisse beibehalten (also nicht Stretch). Wie mache ich das?

Bin für jede Hilfe dankbar!

mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)
Aya
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Mo 31.03.03 12:10 
Hi,

am einfachsten geht das mit Stretch *grinst fies* Aber dann mußt du davor erstmal die maße vom TImage ändern.. und zwar so:

Faktor = Bitmap.Width / Bitmap.Height

Wenn Bitmap.Width > Bitmap.Height dann:
NeueHöhe = Bitmap.Width / Faktor

Wenn Bitmap.Width < Bitmap.Height dann:
NeueHöhe = Bitmap.Width * Faktor

Das ganze geht umgelehrt auch wenn du die Höhe fest vorgeben willst und die Breite sich ändern soll (dann einfach das / und * umtauschen *g*)

Au'revoir,
Aya~

_________________
Aya
I aim for my endless dreams and I know they will come true!
Aya
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Mo 31.03.03 12:11 
Ups.. bin ich doof :oops:

Es geht noch einfacher *g* stell enfach beim TImage "Proportional" auf "True"... *schaut verlegen*

Au'revoir,
Aya~

_________________
Aya
I aim for my endless dreams and I know they will come true!
GSE Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: Mo 31.03.03 21:07 
Danke erst mal für die Hilfe!

Aber die Eigenschaft Proportional gibt´s in meinem TImage nicht (D5 Prof.).
Gibt´s die erst in neueren Delphi-Versionen?

mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)
Aya
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Mo 31.03.03 23:29 
Hi,

mh.. ja kann gut sein das es die bei D5 nochnet gab... mußt es halt auf die von mir beschriebene methode machen ;)

Au'revoir,
Aya~

_________________
Aya
I aim for my endless dreams and I know they will come true!