Autor Beitrag
ggehrma
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 111

WinXP
D2005 Pers.
BeitragVerfasst: So 24.07.05 20:53 
Hallo,

Ich habe ein TImage auf dem wärend der Laufzeit gezeichnet wird. Nun kann es aber passieren, dass mehr gezeichnet werden soll als Platz auf dem TImage ist. In diesem Fall möchte ich die Größe des TImage so anpassen, dass alles darauf Platz hat und das Form gescrollt werden muss. Wie kann ich das am besten erreichen?

Danke.
mfg, ggehrma.

_________________
"...To boldly go where no one has gone before."
Matthias-K
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 271

Win95, Win98, Win2000, WinXP, Linux
D2, D4 Client/Server, D5 Enterprise, D6 Enterprise, D7 Enterprise, Delphi2005, C/C++ 3.0, C/C ++ 5.0, C/C++ 6.0
BeitragVerfasst: So 24.07.05 20:57 
indem du width und height setzt!

matthias

_________________
Ein Spezialist ist ein Mensch, der immer mehr von immer weniger weis, bis er alles von nichts weis!
ggehrma Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 111

WinXP
D2005 Pers.
BeitragVerfasst: So 24.07.05 21:23 
user profile iconMatthias-K hat folgendes geschrieben:
indem du width und height setzt!


Nein, eben nicht! Damit verändert man nicht den zeichenbaren Bereich.

_________________
"...To boldly go where no one has gone before."
Matthias-K
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 271

Win95, Win98, Win2000, WinXP, Linux
D2, D4 Client/Server, D5 Enterprise, D6 Enterprise, D7 Enterprise, Delphi2005, C/C++ 3.0, C/C ++ 5.0, C/C++ 6.0
BeitragVerfasst: Mo 25.07.05 09:39 
Dann erklärs genauer, das man weis, was du von einem willst!

wenn du sagst, du willst das image vergrößern, dann schließe ich daraus, das du das image vergrößern willst!

und wenn ich dann lese: "Nein, eben nicht!".

Drücke dich bitte etwas gewählter aus! in der Fragestellung SOWIE in der Antwort.

_________________
Ein Spezialist ist ein Mensch, der immer mehr von immer weniger weis, bis er alles von nichts weis!
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Mo 25.07.05 12:01 
Falls du das Canvas vergrößern willst: 1) Bild in Bitmap temporär kopieren 2) Image1.Picture:=nil; 3) FillRect benutzen, um die Größe festzulegen 4) Temporäres Bitmap wieder draufpacken

Gruß,
maxk

*Matthias-K Recht geb*

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.
Popov
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1655
Erhaltene Danke: 13

WinXP Prof.
Bei Kleinigkeiten D3Pro, bei größeren Sachen D6Pro oder D7
BeitragVerfasst: Mo 25.07.05 12:30 
In dem du bei der TImage AutoSize auf TRUE setzt und die TImage in eine ScrollBox einfügst ;)

Beispiel als Anlage:
Einloggen, um Attachments anzusehen!
_________________
Popov
ggehrma Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 111

WinXP
D2005 Pers.
BeitragVerfasst: Di 26.07.05 15:00 
Ok, hab mich vielleicht etwas undeutlich ausgedrückt. Sorry.

Ich möchte die Zeichenfläche meines TImage wärend der Laufzeit vergrößern. Dachte da an sowas:
ausblenden Quelltext
1:
TImage1.Picture.Width := TImage.Picture.Width + 50;					


Aber leider ist Picture.Width ja nur ReadOnly.

@maxk: Hört sich ganz gut an was du da schreibst. Aber geht das nicht vielleicht noch etwas einfacher?

_________________
"...To boldly go where no one has gone before."
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Di 26.07.05 19:40 
Nicht das ich wüsste. Ich sitze gerade nicht an meinem Delphirechner, aber evtl. kann dir TPaintbox auch weiterhelfen, da du ja sowieso selbst zeichnen willst. Was ich oben beschrieben habe, ist übrigens nicht "schwierig". Das ist ein Code von (wenn er sauber geschrieben ist!) etwa 7 Zeilen. Versuch es, so wie es beschrieben ist. Wenn du Probleme hast, frag nochmal nach ;)

Gruß,
maxk

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.
ggehrma Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 111

WinXP
D2005 Pers.
BeitragVerfasst: Fr 29.07.05 15:09 
Hallo,

ich hab das jetzt so gemacht:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
    tempBild := frmStat.Bild.Picture.Bitmap;
    frmStat.Bild.Picture := nil;
    frmStat.Bild.Width := frmStat.Bild.Width + (Ext.Count-21)*XE;
    frmStat.Bild.Canvas.Rectangle(0,0,frmStat.Bild.Width, frmStat.Bild.Height);
    frmStat.Bild.Picture.Bitmap := tempBild;


Funktioniert aber lieder nicht. Wo liegt mein Fehler?

Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.

_________________
"...To boldly go where no one has gone before."
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19312
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Fr 29.07.05 15:14 
Bitmap lässt sich so nicht zuweisen (letzte Zeile). Das geht, wenn, dann mit Assign. Aber du solltest das tempBild stattdessen mit Draw auf dein Image zeichnen. Ansonsten bringt die deine vorletzte Zeile rein gar nix, wenn die letzte funktionieren würde, da das alles wieder weg wäre...
ggehrma Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 111

WinXP
D2005 Pers.
BeitragVerfasst: Sa 30.07.05 13:30 
Alles klar, funktioniert. Danke.

_________________
"...To boldly go where no one has gone before."