Autor Beitrag
The...
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 122



BeitragVerfasst: Sa 01.10.05 15:15 
hi,
ich mache da gerade nen prog mit nem bild, das muss übern ganzen bildschirm gehen. bei miner auflösung (1280*1024-19er) passt das denn auch. wenn ich das ber nun mit na 1024*768 (17er) mache fehlt da was. in der mitte des bildes ist auch noch nen label das da bleiben muss (also in der mitte).

wie bekomme ich das hin :?:
NeoInDerMATRIX
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 245

Win95, Win98(+se), WinNT, Win2000, WinME, WinXP(+pro), VISTA, Linux(SuSe), DOS [MultiMon(3)], Vista
D6 PeE + (FP 2.0l) + D3 Pe + D2005+ D2006 Arch
BeitragVerfasst: Sa 01.10.05 16:09 
In dem du das bild in ein, z.B. Canvas, packst und dann auf die größe anpast.

Cu
Neo
Calyptus
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 386

Win Xp Prof
D3, D6 Pers, D7 Ent
BeitragVerfasst: Sa 01.10.05 16:27 
Zum Bild:
ausblenden Delphi-Quelltext
1:
2:
Image1.Align := alClient;
Image1.Stretch := true;

Damit wird Image1 immer an die größe deiner Form angepasst und das Bild so gestreckt das es auch passt.

Zum Label:
Am besten bei OnResize von Form1 oder vllt auch beim OnCreate
ausblenden Delphi-Quelltext
1:
2:
Label1.Left := Form1.ClientWidth div 2 - Label1.Width div 2;
Label1.Top := Form1.ClientHeight div 2 - Label1.Height div 2;

_________________
Luft- und Raumfahrtechnik an der Uni Stuttgart
The... Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 122



BeitragVerfasst: So 02.10.05 11:45 
ja, also das bild ist nun richtig...danke :D
ausblenden Delphi-Quelltext
1:
2:
Label1.Left := Form1.ClientWidth div 2 - Label1.Width div 2;
Label1.Top := Form1.ClientHeight div 2 - Label1.Height div 2;


aber wofür ist welche zahl? ich muss das label etes anpassen damit es richtig passt.
habe versucht die zahlen etwas zu verändern aber es springt immrt zu weit!

???
Kokel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 79

XP Prof
delphi 2006 Prof.
BeitragVerfasst: So 02.10.05 13:24 
Label1.Left > Linke Seite des Bildes
Form1.ClientWidth div 2 > die breite von Form1 : 2 (Also die Mitte)
- Label1.Width div 2; > minus die Hälfte von Label1

für height ( höhe ) dito


Dann muß das Bild normalerweise mittig sein.

wenn nicht hast du vielleicht einen unterschiedlichen Rand in deiner Bitmap ?
Dann würd ich den erstmal mit einem Grafikprogramm abschneiden.
The... Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 122



BeitragVerfasst: So 02.10.05 14:20 
also das bild ist gerade aber das label nicht in der mitte! gibt es da nich noch andere möglichkeiteb, oder woran könnte das noch liegen?
Kokel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 79

XP Prof
delphi 2006 Prof.
BeitragVerfasst: So 02.10.05 14:26 
Zeig ma den Quelltext
The... Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 122



BeitragVerfasst: So 02.10.05 14:59 
jao... also hier:


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure TForm1.FormCreate(Sender: TObject);

begin

Groupbox2.Left := Form1.ClientWidth div 2 - Groupbox2.Width div 2;
Groupbox2.Top := Form1.ClientHeight div 2 - Groupbox2.Height div 2;

...



???
Kokel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 79

XP Prof
delphi 2006 Prof.
BeitragVerfasst: So 02.10.05 15:02 
vielleicht ist das oncreate ereignis nicht so okay?
versuchs mal mit onshow
The... Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 122



BeitragVerfasst: So 02.10.05 16:10 
ahhhhh... danke, das eine geht nun:-)

nun habe ich aber noch nen zweites das so ein stück darüber muss!
wie geht das?
Calyptus
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 386

Win Xp Prof
D3, D6 Pers, D7 Ent
BeitragVerfasst: Mo 03.10.05 02:06 
Überlegen!

Du willst es in der Mitte haben, aber x über der Mitte. Also das gleiche wie vorhin nur eben noch - x (x= Soviel Pixel wie es über der Mitte sein soll)

ausblenden Delphi-Quelltext
1:
2:
3:
4:
//LinksRechts immernoch in der Mitte
Groupbox2.Left := Form1.ClientWidth div 2 - Groupbox2.Width div 2;
//ObenUnten - x
Groupbox2.Top := Form1.ClientHeight div 2 - Groupbox2.Height div 2 - x;

_________________
Luft- und Raumfahrtechnik an der Uni Stuttgart