Ich will ein Programm erstellen und ich brauche die originalgröße eines Bildes im GUI.
[autoit]GuiCtrlCreatePic("Beispiel.bmp",100,100,???,???)
[/autoit]Breuche ich irgendein Style oder Ex-Style?????
An alle Profis: Bitte helft mir
Ich will ein Programm erstellen und ich brauche die originalgröße eines Bildes im GUI.
[autoit]GuiCtrlCreatePic("Beispiel.bmp",100,100,???,???)
[/autoit]Breuche ich irgendein Style oder Ex-Style?????
An alle Profis: Bitte helft mir
110 x 110 pixel (BildInfo)
oder was willst du wissen?
Hallo und herzlich :willkommen: im Forum
Also ich würde das UDF von Simucal nehmen ( _GetExtProperty )
hab dir mal schnell ein bsp skript geschrieben:
$pic = FileOpenDialog("Bitte wähle ein Bild aus","","Bilder (*.bmp;*.jpg;*.gif)|Alle (*.*)")
$width = StringTrimRight(_GetExtProperty($pic,27),StringLen(" Pixel"))
$heigth = StringTrimRight(_GetExtProperty($pic,28),StringLen(" Pixel"))
MsgBox(0,"","Die auflösung: "&$width&"x"&$heigth)
;===============================================================================
; Function Name: GetExtProperty($sPath,$iProp)
; Description: Returns an extended property of a given file.
; Parameter(s): $sPath - The path to the file you are attempting to retrieve an extended property from.
; $iProp - The numerical value for the property you want returned. If $iProp is is set
; to -1 then all properties will be returned in a 1 dimensional array in their corresponding order.
; The properties are as follows:
; Name = 0
; Size = 1
; Type = 2
; DateModified = 3
; DateCreated = 4
; DateAccessed = 5
; Attributes = 6
; Status = 7
; Owner = 8
; Author = 9
; Title = 10
; Subject = 11
; Category = 12
; Pages = 13
; Comments = 14
; Copyright = 15
; Artist = 16
; AlbumTitle = 17
; Year = 18
; TrackNumber = 19
; Genre = 20
; Duration = 21
; BitRate = 22
; Protected = 23
; CameraModel = 24
; DatePictureTaken = 25
; Dimensions = 26
; Width = 27
; Height = 28
; Company = 30
; Description = 31
; FileVersion = 32
; ProductName = 33
; ProductVersion = 34
; Requirement(s): File specified in $spath must exist.
; Return Value(s): On Success - The extended file property, or if $iProp = -1 then an array with all properties
; On Failure - 0, @Error - 1 (If file does not exist)
; Author(s): Simucal ([email='Simucal@gmail.com'][/email])
; Note(s):
;
;===============================================================================
Func _GetExtProperty($sPath, $iProp)
Local $iExist, $sFile, $sDir, $oShellApp, $oDir, $oFile, $aProperty, $sProperty
$iExist = FileExists($sPath)
If $iExist = 0 Then
SetError(1)
Return 0
Else
$sFile = StringTrimLeft($sPath, StringInStr($sPath, "\", 0, -1))
$sDir = StringTrimRight($sPath, (StringLen($sPath) - StringInStr($sPath, "\", 0, -1)))
$oShellApp = ObjCreate ("shell.application")
$oDir = $oShellApp.NameSpace ($sDir)
$oFile = $oDir.Parsename ($sFile)
If $iProp = -1 Then
Local $aProperty[35]
For $i = 0 To 34
$aProperty[$i] = $oDir.GetDetailsOf ($oFile, $i)
Next
Return $aProperty
Else
$sProperty = $oDir.GetDetailsOf ($oFile, $iProp)
If $sProperty = "" Then
Return 0
Else
Return $sProperty
EndIf
EndIf
EndIf
EndFunc ;==>_GetExtProperty
Mfg Spider
ok, ist lange her, aber ich bedanke mich ma trotzdem schnell
jetzt kann man ja auch die gdiplus benutzen... gabs früher (glaubich) nicht...
aber das mit dem gdiplus sieht etwas umständlicher aus, wenn man sich dafür erstma startuppen und dann shutdownen muss...
vllt benutz ich ab jetzt doch das...
cya
(ps: ich wusste nit, dass ich einen king stp account hier registriert hatte... habs zufällig grad gesehen)
gn8
Hi,
aus einem anderen Forum:
ZitatAlles anzeigenI got Microsoft to admit it was a negative sideeffet of a Security Update and Service Pack 2!
That means I have also got a solution now! ;o)
RESOLUTION:
You may experience the above described unexpected result after the installation of security update 908531 (security bulletin MS06-015, which is also included in Windows 2003 Server Service Pack2).
The solution is to allow access to the extended file attributes by adding the following registry entry.
Either add the following entry, or copy the below lines, paste them in an empty text file and save it with the .reg extension. Then run the file to add the appropriate values into the registry.
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Cached]"{875CB1A1-0F29-45DE-A1AE-CFB4950D0B78} {0000010B-0000-0000-C000-000000000046} 0x401"=dword:00000001
Your problem was a consequence introduced by the security update MS06-015 analogous to http://support.microsoft.com/kb/918165
So now I will stop this thread, and DEAR ROB!! I thank You very much for all your tries in finding the impossible solution.. but now I finally found it and I have pasted it here, so others can solve this frustrating problem.. ;o)
==> Die Infos für Height, Width und einiges andere wird nicht mehr zurückgeliefert.
In der Registry muss o.g. Schlüssel eingetragen werden, damit es wieder funzt. Liegt im Anhang. Einfach entpacken, doppelt anklicken, und die Infos werden hinzugefügt. Dann noch den Rechner neu starten, sonst funktioniert es nicht...
Es kann sein, dass man ab SP3 o.g. Methode wieder ohne Probleme nutzen kann, ist aber nur eine Vermutung.
Gruß
trainer