Autor Beitrag
Ivy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 228



BeitragVerfasst: Di 22.11.11 15:28 
Hallo zusammen,
ich habe ein TabellayoutPanel gefüllt sind die Rows mit Pictureboxen die jeweils verschiedene Bilder beinhalten (werden über die Bildadresse geladen). Nun möchte diese Bilder die sich in meinem TableLayoutPanel befinden in einer XML Datei speichern. Wie kann ich herausfinden welche items bzw bilder sich gerade in meinem Panel befinden??

LG IVY
Trashkid2000
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 561
Erhaltene Danke: 137



BeitragVerfasst: Di 22.11.11 16:26 
Hi,
also so gar nicht. Du kannst aber bei den Bildern als Tag-Eigenschaft den Pfad speichern.
Und das kannst Du dann zusammen mit Column/ Row aus dem Panel in eine XML schreiben.

LG,
Ivy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 228



BeitragVerfasst: Di 22.11.11 16:33 
aha was für ne Tag eigenschaft?? hast du nen besipiel?
ich hab die bilder jetzt so in das panel geladen:

ausblenden C#-Quelltext
1:
 pb.Image = System.Drawing.Image.FromFile(@"D:\");					
Trashkid2000
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 561
Erhaltene Danke: 137



BeitragVerfasst: Di 22.11.11 18:28 
Na so:
ausblenden C#-Quelltext
1:
2:
pb.Image = Image.FromFile(@"D:\meinBild.png");
pb.Image.Tag = @"D:\meinBild.png";
So hast Du zu jedem Bild gespeichert, von wo es geladen wurde. Diese Information geht sonst verloren.
Beim wiederabrufen der Eigenschaft musst Du das Object wieder in einen string casten.
Ivy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 228



BeitragVerfasst: Mi 23.11.11 08:47 
okay, danke.
kann ich darin auch mehrere bilder speichern? Also mein bild wird eingesetz in einer schleife und das geht solange bis die liste leer ist. Kann ich also auf das erste bild weiter zugreifen oder wird das dann überschrieben?? Weil dann müsste ich die Tags ja über ein Array einspeichern...
Trashkid2000
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 561
Erhaltene Danke: 137



BeitragVerfasst: Mi 23.11.11 09:36 
Also pb ist doch eine PictureBox, oder?
Und in einer PictureBox kann doch nur ein Bild reingepackt werden. Deshalb verstehe ich die Frage nicht so wirklich.
Ivy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 228



BeitragVerfasst: Mi 23.11.11 10:02 
ja ne, es wird für jedes bild eine neue Picturebox erstellt...