Autor Beitrag
kiwicht
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1021

Win 7, MacOS
Delphi x, VBA, PHP, ...
BeitragVerfasst: Fr 07.02.03 14:08 
Hallo z´sammen

ich hab hier meine kleine datenbank, in der gibts n feld, welches den kompletten pfad mit dateiname etc. zu einem bild beinhaltet.

nun will ich dieses bild auf dem formular anzeigen lassen, und hab dazu ein TDBImage auf meinem formular plaziert, und wollte diesem zur laufzeit den Feld-Inhalt meiner DB zuweisen, um das dort angegebene bild zu laden... logisch.

klappt aber nicht, er zeigt das bild partout nicht an...

weiß einer rat?!?

mfg und danke im voraus..

kiwicht
GuGl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 35



BeitragVerfasst: Fr 07.02.03 17:16 
Hallo kiwicht,

in einem DBImage kannst du das bild nur dann anzeigen wenn du
ein BLOB-Feld in der DB hast in welchem das Bild direkt gespeichert ist.

In deinem Fall mußt Du ein normales Image nehmen und das Bild
zur Laufzeit laden mit:

Image1.picture.loadfromfile(....hier der Pfad aus deinem DB-Feld...);

_________________
Gruß, GuGl
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Fr 07.02.03 19:24 
jetzt aber mal langsam. Der Dateiname sollte schon in der DB gespeichert werden, nehme ich mal an, als string bzw. CHAR (XYZ). Werde mich dann eben übers Wochenende damit beschäftigen. Brauche so was ähnliches.

Gruß
Hansa
kiwicht Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1021

Win 7, MacOS
Delphi x, VBA, PHP, ...
BeitragVerfasst: Fr 07.02.03 19:38 
jo.. es klappt...

nochma für alle.. ;)

DBFeld: bilder , speichert als char den pfad, komplett mit filename

ausblenden Quelltext
1:
2:
3:
4:
// on MEINGRID.KEYPRESS.ETC do what i say now:
varBild := qrDatabase.FieldValues['BILDER'];
if FileExists(varBild) then Image1.Picture.LoadFromFile(varBild)
else Image1.Picture.LoadFromFile('c:\res\no-pic.jpg');


fertig... vorher musst ich natürlich noch jpeg von hand bei "uses" eintragen, damit er auch die liest.. logen ... :D

danke für eure hilfe!

mfg
kiwicht
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Fr 07.02.03 19:46 
muß den Mist jetzt auch noch hinkriegen. Was ist, wenn es kein JPEG ist ? Die Methode an sich müßte doch so stimmen, oder? Dann mach ich nämlich mal da mal weiter.

Gruß
Hansa
kiwicht Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1021

Win 7, MacOS
Delphi x, VBA, PHP, ...
BeitragVerfasst: Fr 07.02.03 21:48 
wenns kein jpg ist? gute frage... aber soweit ich weis unterstützt delphi doch so ziemlich jedes wichtige bild-format... wenn nicht gibts da bestimmt noch n paar nützliche komponenten.... aber lass mich wissen, wenn du lösungsansätze für fremde formate findest :)

bis die tage
mfg
kiwicht
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Fr 07.02.03 22:12 
Hi,

hier steht noch was zu dem Thema (mit meinem Senf dazu), aber auch ein paar gute Links.

www.delphi-forum.de/...1&highlight=bild

Aber lach Dich nicht tot, ich beschäftige mich nur am Rande mit diesem Thema. :mrgreen:

Gruß
Hansa