![]() |
|
|
Banner und Co. |
![]() |
Ads |
|
Themen-Optionen | Ansicht |
![]() |
#1 |
![]() Neuer Benutzer |
![]() Liebe Helfer,
in einer Tabelle befinden sich Kundendaten und Auftragseinzelheiten. In einer Userform sollen diese angezeigt werden, wobei das Produkt bei jedem Auftrag als jpg in einem Image dargestellt wird (die Quelle dieses Bildes ist als Pfadangabe ebenfalls in der Tabelle enthalten). Die Bilder sind entweder querformatig oder hochformatig. Bisher habe ich das Image einfach quadratisch formatiert, um beide Bildformate ohne Verzerrung darstellen zu können. Lieber wäre es mir aber, wenn ich aus der jpg-Datei die Maße des Bildes auslesen und dann den Platzhalter entsprechend dimensionieren könnte - die Fotos könnten dann größer dargestellt werden. Es gibt ja Tools, um EXIF-Eigenschaften auslesen zu können, aber dann müsste ich diese Information womöglich händisch in die Tabelle eintragen. Vielleicht gibt es da noch andere Möglichkeiten. Kann mir da jemand behilflich sein? Gruß Oswald |
![]() |
![]() ![]() |
![]() |
#2 |
![]() MOF Koryphäe |
![]() Mit der Funktion kannst Du die Dimensionen auslesen
Code: Private Function getFileDimensions(ByVal filePath As String, ByVal fileName As String) As String With New Shell32.Shell With .Namespace(filePath).ParseName(fileName) getFileDimensions = .ExtendedProperty("Dimensions") End With End With End Function __________________ How do I ask a good question?In a lot questions the OP has no idea what they're doing, they've found code on the internet, mixed it around and got something. They don't understand why that something doesn't work. Usually, in these questions, the original poster is rather clueless, helping them on the question is only spoon feeding them, and there is little to no chance the question will help anyone in the future. Press any key to continue - or any other key to abort. Spoon feeding: provide (someone) with so much help or information that they do not need to think for themselves. |
![]() |
![]() ![]() |
![]() |
#3 |
Threadstarter
![]() ![]() Neuer Benutzer |
![]() Hallo Storax,
beim Ausprobieren der Funktion wird mir das New Shell32.Shell blau hinterlegt und folgende Fehlermeldung angezeigt: Fehler beim Kompilieren: Benutzerdefinierter Typ nicht definiert Was muss ich da vorher noch tun? --> Sorry, jetzt Hinweis auf Stackoverflow gelesen und Verweis eingefügt. Gruß und vielen Dank! Das ging ja rasend schnell… Oswald Geändert von OsCor (07.12.2018 um 19:37 Uhr). Grund: Ergänzung in fett |
![]() |
![]() ![]() |
![]() |
#4 |
![]() MOF Koryphäe |
![]() Z.B. die Quellenangabe lesen
__________________ How do I ask a good question?In a lot questions the OP has no idea what they're doing, they've found code on the internet, mixed it around and got something. They don't understand why that something doesn't work. Usually, in these questions, the original poster is rather clueless, helping them on the question is only spoon feeding them, and there is little to no chance the question will help anyone in the future. Press any key to continue - or any other key to abort. Spoon feeding: provide (someone) with so much help or information that they do not need to think for themselves. |
![]() |
![]() ![]() |
![]() |
#5 |
Threadstarter
![]() ![]() Neuer Benutzer |
![]() Hinweis auf meine Korrektur und deine Antwort zeitgleich
![]() |
![]() |
![]() ![]() |