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



BeitragVerfasst: Mo 24.10.11 09:16 
Hallo,
ich habe ein Problem mit der funktion printable listview. In meiner Listview befindet sich kein text sondern images. Wenn ich jetzt meine Listview drucken will, was theoretisch bei mir klappt (Printpreview geht) ist mein Blatt aber leer?! Kann man das überhaupt auch mit bildern so praktizieren? Oder woran liegt es dass es mir meine listview nicht anzeigt mit den bildern?

Danke
LG
Th69
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Moderator
Beiträge: 4807
Erhaltene Danke: 1061

Win10
C#, C++ (VS 2017/19/22)
BeitragVerfasst: Mo 24.10.11 17:26 
Hallo Ivy,

was genau meinst du mit "printable listview"? So eine Methode gibt es standardmäßig nicht.
Zum Drucken von Bildern wirst du dann wohl Graphics.DrawImage() o.ä. benutzen müssen.
Ivy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 228



BeitragVerfasst: Di 25.10.11 15:28 
habs nach diesem prinzip gemacht: www.codeproject.com/...intableListView.aspx
dachte es macht vielleicht keinen unterschied ob sich in der LV bilder oder text befinden?!
Ralf Jansen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 4708
Erhaltene Danke: 991


VS2010 Pro, VS2012 Pro, VS2013 Pro, VS2015 Pro, Delphi 7 Pro
BeitragVerfasst: Di 25.10.11 15:48 
OnPrintPage benutzt DrawRectangle für die Tabellenansicht und DrawString zur Ausgabe der Daten. Offensichtlich kann man damit keine Images ausgeben.
Ivy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 228



BeitragVerfasst: Di 25.10.11 16:07 
user profile iconRalf Jansen hat folgendes geschrieben Zum zitierten Posting springen:
OnPrintPage benutzt DrawRectangle für die Tabellenansicht und DrawString zur Ausgabe der Daten. Offensichtlich kann man damit keine Images ausgeben.


na toll... und jetzt? gibt es eine andere möglichkeit meine LV zu drucken?
Th69
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Moderator
Beiträge: 4807
Erhaltene Danke: 1061

Win10
C#, C++ (VS 2017/19/22)
BeitragVerfasst: Di 25.10.11 17:58 
Dann ändere doch einfach den Code entsprechend ab, d.h. mein schon erwähntes Graphics.DrawImage() aufrufen.
Ivy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 228



BeitragVerfasst: Mi 26.10.11 07:57 
ah wie? die DLL ändern? (PrintableListView) dort ist ja auch der DrawString vermerkt?
Ralf Jansen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 4708
Erhaltene Danke: 991


VS2010 Pro, VS2012 Pro, VS2013 Pro, VS2015 Pro, Delphi 7 Pro
BeitragVerfasst: Mi 26.10.11 09:20 
Was sonst? Den Source Code bei Codeproject runterladen und entsprechend deinen Wünschen anpassen.
Ivy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 228



BeitragVerfasst: Mo 31.10.11 14:31 
also ich hab in der DLL statt DrawString DrawImage eingetragen, jedoch funktionirert die dll dann nicht mehr. mein compiler meckert dass die datei nicht mehr vorhanden wäre??!
Ivy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 228



BeitragVerfasst: Do 03.11.11 15:07 
kann mir keiner weiterhelfen?? Komm da nicht weiter :(
Th69
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Moderator
Beiträge: 4807
Erhaltene Danke: 1061

Win10
C#, C++ (VS 2017/19/22)
BeitragVerfasst: Do 03.11.11 20:40 
Hallo Ivy,

was genau hast du jetzt geändert? Ich hoffe mal, den Sourcecode und daraus dann eine DLL erstellt, und nicht etwa direkt die DLL?
Ivy Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 228



BeitragVerfasst: Fr 04.11.11 10:57 
user profile iconTh69 hat folgendes geschrieben Zum zitierten Posting springen:
Hallo Ivy,

was genau hast du jetzt geändert? Ich hoffe mal, den Sourcecode und daraus dann eine DLL erstellt, und nicht etwa direkt die DLL?


doch :D ja was soll ich denn im source code da ändern? ich hab da nichts gefunden... also was mit dem draestring irgendwie zu tun haben könnte
Th69
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Moderator
Beiträge: 4807
Erhaltene Danke: 1061

Win10
C#, C++ (VS 2017/19/22)
BeitragVerfasst: Fr 04.11.11 13:41 
Hallo Ivy,

in der Datei "TestSolution\PrintableListView\PrintableListView.cs" wird in der Methode OnPrintPage() die komplette Druckausgabe gemacht (inkl. DrawString).
Natürlich mußt du jetzt ein bißchen ausprobieren und debuggen, wo und wie du genau dein Image anzeigen mußt, aber das ist eine gute Übung.