Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Mit ASP die Höhe und Breite eines Bild ermitteln?

Empfohlene Antworten

Veröffentlicht

Hi an alle,

Ich habe mal eine frage, kann man in oder mit ASP die Höhe und Breite von ein Bild-Datei ermitteln?

Und wenn ja, wie funktioniert das?

Ich bedanke mich schon mal in vorraus für alle Antworten.

MFG

Atlantis

Moing!

Also man kann die Größe eines Bildes schon in ASP ermitteln...

Ich schau mal nach, wie genau das geht.....

Grundprinzip: Im Scripting.FileSystemObject die Datei binär auslesen und "mitzählen", dann umrechnen in Pixel.....

Da gibt bestimmt einen link, wo das ganze gecoded ist.. momentchen..:beagolisc


<%

Option Explicit


   Dim objFS

   Dim objImageFile

   Dim strStream

   Dim strWidth

   Dim strHeight

   Dim strImage

   Dim strFileSize


   strImage = "../hier_steht_mein_Bildchen.gif"


   Set objFS = CreateObject( _

      "Scripting.FileSystemObject")

   Set objImageFile = objFS.GetFile( _

      Server.MapPath(strImage))

   strFileSize = CStr(objImageFile.Size)

   Set objImageFile = Nothing


   Set objImageFile = objFS.OpenTextFile( _

      Server.MapPath(strImage), 1)


   strStream = objImageFile.Read(11)

   objImageFile.Close

   Set objImageFile = Nothing

   Set objFS = Nothing


   ' --------------------------------------------------------------

   ' Umwandeln der binären Informationen in

   ' verwertbare Daten

   '

   ' Die Breite befindet sich in den Bytes 7 und 8

   ' Die Höhe befindet sich in den Bytes 9 und 10

   ' --------------------------------------------------------------

   strWidth = CStr(Asc(Mid(strStream, 7, 1)) + _

      Asc(Mid(strStream, 8, 1)) * 256)


   strHeight = CStr(Asc(Mid(strStream, 9, 1)) + _

      Asc(Mid(strStream, 10, 1)) * 256)



%>

Dann klappts auch mitm Nachbarn....:D

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.