Autor Beitrag
Land-Gull
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 51

SuSe 9.2, WIN XP
D7 Enter
BeitragVerfasst: So 28.08.05 13:46 
Hi Leute,

wisst ihr wie ich ohne TImage zu benutzen, statt der öden einheitlichen Formularfarbe eine HintergrundPic machen kann?

Danke


Moderiert von user profile iconGausi: Topic aus Sonstiges verschoben am So 28.08.2005 um 14:55
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: So 28.08.05 13:52 
Unter .Net hat TWinForm ne Eigenschaft dafür
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: So 28.08.05 13:54 
Im OnPaint-Event selber zeichnen (Suche in: Delphi-Forum, Delphi-Library "CANVAS"), es könnte aber sein, daß dadurch unter Umständen alle Labels und Paintboxes verschwinden... :angel:

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: So 28.08.05 13:55 
Z.B. so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
bmp:=TBitmap.Create;
bmp.LoadFromFile('c:\meinbild.bmp');
Form1.Canvas.Draw(0,0,bmp);
bmp.Free;

Allerdings musst du dich dann ggf. auch um das Neuzeichnen kümmern, wenn die Form in den Hintergrund gesetzt wurde, oder durch sonstwas einige Teile verdeckt wurden.

_________________
We are, we were and will not be.
Amateur
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 777

(Win98, WinMe) WinXP Prof
D3 Prof, D6 Pers, D2k5 Pers., Turbo C++ Explorer
BeitragVerfasst: So 28.08.05 14:09 
ich würde nen image verwenden... wieso willst du denn keins? find ich einfacher... packste entweder schon vorher drauf oder createst es zur laufzeit... kann man ganz einfach an die formulargröße anpassen... und man hat keine probs mit verdecken von irgendwas oder so...

_________________
"Kein dummes Gerede. Kein Rumrätseln. Denkt an nichts anderes mehr, nur noch an das, was vor euch liegt. Das ist die wahre Herausforderung. Ihr müßt euch vor euch selbst schützen, Leute." (Rennes in "Cube")
Beiträge: >700
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: So 28.08.05 14:10 
user profile iconGausi hat folgendes geschrieben:
Allerdings musst du dich dann ggf. auch um das Neuzeichnen kümmern, wenn die Form in den Hintergrund gesetzt wurde, oder durch sonstwas einige Teile verdeckt wurden.
Deswegen erwähnte ich das OnPaint-Event, da tut Windows das alles automatisch ;-)
Übrigens ist es nicht empfehlenswert, im OnPaint-Event jedes Mal das Bitmap-Objekt zu erzeugen, aus der Datei zu laden und anschließend wieder zu löschen. Das kann man bei einem einmaligem Event machen, aber nicht bei OnPaint. Hier empfiehlt sich ein Bitmap-Objekt, das während der gesamten Lebenszeit des Fenster existiert (z.B. als Eigenschaft des Fensters, erzeugt im Konstruktor des Objektes, zerstört im Destruktor) und auf das ich im OnPaint nur einmal lesend zugreife. Das ständige Neuladen kann je nach Görße des Bildes zu hässlichen Performanceproblemen führen.

Edit: Sorry, Daniel, habe nicht auf die Zeit geachtet, meinen Post hast du wohl vorher gar nicht gesehen ;-)

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: So 28.08.05 14:21 
Ne, hab ich wirklich nicht ;-)

Natürlich ist es ungünstig, bei jedem OnPaint-Ereignis das Bitmap zu erzeugen und aus einer Datei zu laden. Da ich sowas noch nicht probiert habe, hab ich das zum Testen ins OnClick eines Buttons gepackt. An das OnPaint-Ereignis der Form hab ich zuerst gar nicht gedacht.
Hauptsache, wir haben jetzt ne praktikable Lösung für Land-Gull gefunden :D

_________________
We are, we were and will not be.
Land-Gull Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 51

SuSe 9.2, WIN XP
D7 Enter
BeitragVerfasst: So 28.08.05 14:28 
Jop, danke für eure Hilfe.
Probier ich gleich mal aus.