Autor Beitrag
beljo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 129



BeitragVerfasst: Mi 15.03.06 10:36 
Hallo Leute,
ich habe über einen Button eine bmp- Datei aufrufen lassen, und zwar so
ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.Button4Click(Sender: TObject);    //Bildaufruf Nut1
begin
 Image1.picture.LoadFromFile('H:\Nutenformen\bearbeitet\Stator1.bmp');
end;

Leider weis ich nicht wie ich es über einen anderen Button das Bitmap wieder Löschen bzw entfernen kann.(Nicht zu finden in meinen Buch).
Vielleicht kann mir da jemand helfen.
danke im vorraus.
Jailbird
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 127

Windows XP Pro SP2
Delphi 7 Professional
BeitragVerfasst: Mi 15.03.06 11:05 
ausblenden Delphi-Quelltext
1:
Image1.Picture := nil;					


Wobei ich mir dabei nicht 100% sicher bin, ob der Speicher auch freigegeben wird. Allerdings klappts mit Free nicht, also geh ich davon aus, dass das Image das Bild ownt ;)

_________________
Jailbird
cherry
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 136

WinXP - Professional
RAD Studio 2009
BeitragVerfasst: Mi 15.03.06 11:08 
user profile iconbeljo hat folgendes geschrieben:

Image1.picture.LoadFromFile('H:\Nutenformen\bearbeitet\Stator1.bmp');


Was gibt denn das für ein Programm?! :P

_________________
AM I TOO SEXY?
Ist das nur mein Gefühl, oder ist die ganze Welt verrückt geworden!?
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Mi 15.03.06 11:18 
da steht Nuten, nicht Nutten :D

zum Thema:
ausblenden Delphi-Quelltext
1:
Image1.Picture.Bitmap.FreeImage;					

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!


Zuletzt bearbeitet von Kroko am Mi 15.03.06 11:19, insgesamt 1-mal bearbeitet
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8548
Erhaltene Danke: 477

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mi 15.03.06 11:18 
Zusätzlich zu dem Quellcode von Jailbird ist es oft sinnvoll, zusätzlich Image1.visible := False zu setzen, da das bloße setzen auf Nil das aktuelle Bild nicht mit "nichts" übermalt.

@Cherry: Hab ich zuerst auch gedacht - aber da ist nur ein "t". Eine Nut ist nicht unbedingt was anzügliches ;-)

_________________
We are, we were and will not be.
beljo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 129



BeitragVerfasst: Mi 15.03.06 11:23 
Super danke, der Vorschlag von Jailbird hat gelklappt und der Rest interesiert erstmal nicht.
ach ja 'Nuten' sind nicht das was man auf anhieb denkt.
Wenns Interresiert:
Nuten sind bei elektrischen Maschinen eine spezielle 'Unterführung' wo die Wicklungen eingelegt sind.
Naja so oder so ähnlich, schwer zu erklären ohne mit Händen und Füßen zu gestikulieren ;-)