Schaue mal in die Console! ![]()
Gruß,
UEZ
Schaue mal in die Console! ![]()
Gruß,
UEZ
Sehr interessante Spielerei und klasse Lösung eukalyptus ![]()
Gruß,
UEZ
Hier die WMI Version, um die Benutzer auszulesen:
#include <GuiComboBox.au3>
#include <GUIConstantsEx.au3>
$Form1 = GUICreate("Sperrung / Freigabe", 417, 315, 287, 147)
$Label1 = GUICtrlCreateLabel("Benutzername", 10, 72, 109, 24)
$hCombo = GUICtrlCreateCombo("", 120, 72, 289, 24)
GUICtrlSetData(-1, Get_Users())
_GUICtrlComboBox_SetCurSel ($hCombo, 0)
$Label2 = GUICtrlCreateLabel("Montag", 29, 122, 49, 17)
$Label3 = GUICtrlCreateLabel("Dienstag", 23, 150, 55, 20)
$Label4 = GUICtrlCreateLabel("Mittwoch", 27, 176, 51, 19)
$Label5 = GUICtrlCreateLabel("Donnerstag", 8, 204, 70, 18)
$Label6 = GUICtrlCreateLabel("Freitag", 36, 231, 42, 20)
$Label7 = GUICtrlCreateLabel("Samstag", 25, 258, 53, 19)
$Label8 = GUICtrlCreateLabel("Sonntag", 29, 285, 49, 19)
$Label9 = GUICtrlCreateLabel("von", 89, 104, 24, 16)
$Label10 = GUICtrlCreateLabel("bis", 122, 105, 20, 14)
$Input1 = GUICtrlCreateInput("0", 88, 120, 25, 24)
$Input2 = GUICtrlCreateInput("23", 120, 120, 25, 24)
$Input3 = GUICtrlCreateInput("0", 88, 147, 25, 24)
$Input4 = GUICtrlCreateInput("23", 120, 147, 25, 24)
$Input5 = GUICtrlCreateInput("0", 88, 174, 25, 24)
$Input6 = GUICtrlCreateInput("23", 120, 174, 25, 24)
$Input7 = GUICtrlCreateInput("0", 88, 201, 25, 24)
$Input8 = GUICtrlCreateInput("23", 120, 201, 25, 24)
$Input9 = GUICtrlCreateInput("0", 88, 228, 25, 24)
$Input10 = GUICtrlCreateInput("23", 120, 228, 25, 24)
$Input11 = GUICtrlCreateInput("0", 88, 255, 25, 24)
$Input12 = GUICtrlCreateInput("23", 120, 255, 25, 24)
$Input13 = GUICtrlCreateInput("0", 88, 282, 25, 24)
$Input14 = GUICtrlCreateInput("23", 120, 282, 25, 24)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func Get_Users($system = ".")
Local $Users
Local $objWMIService = ObjGet("winmgmts:{impersonationLevel = impersonate}!\\" & $system & "\root\cimv2")
Local $colItems = $objWMIService.ExecQuery("SELECT Caption FROM Win32_UserAccount WHERE Disabled = False", "WQL", 0x30)
For $objItem In $colItems
$Users &= $objItem.Caption & "|"
Next
Return $Users
EndFunc
Gruß,
UEZ
Hier eine alternativ Funktion von Eukalyptus:
[autoit]
Func _Blur($hBitmap, $iW, $iH, $fScale = 0.175, $qual = 6); by eukalyptus
Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND(_WinAPI_GetDesktopWindow())
Local $hBmpSmall = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $hGraphics)
Local $hGfxSmall = _GDIPlus_ImageGetGraphicsContext($hBmpSmall)
Local $hBmpBig = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $hGraphics)
Local $hGfxBig = _GDIPlus_ImageGetGraphicsContext($hBmpBig)
_GDIPlus_GraphicsScaleTransform($hGfxSmall, $fScale, $fScale)
_GDIPlus_GraphicsSetInterpolationMode($hGfxSmall, $qual)
_GDIPlus_GraphicsScaleTransform($hGfxBig, 1 / $fScale, 1 / $fScale)
_GDIPlus_GraphicsSetInterpolationMode($hGfxBig, $qual)
_GDIPlus_GraphicsDrawImageRect($hGfxSmall, $hBitmap, 0, -5, $iW, $iH + 12)
_GDIPlus_GraphicsDrawImageRect($hGfxBig, $hBmpSmall, 0, -3, $iW, $iH + 9)
_GDIPlus_GraphicsDispose($hGraphics)
_GDIPlus_BitmapDispose($hBmpSmall)
_GDIPlus_GraphicsDispose($hGfxSmall)
_GDIPlus_GraphicsDispose($hGfxBig)
Return $hBmpBig
EndFunc ;==>_Blur
Gruß,
UEZ
nun wenn ich z.b. nur ein SW Bild habe mit 60% Schwarzanteil so kann ich mir sicher leicht eine Funktion basteln die mir die Farbe Schwarz als höchsten Farbanteil ausgibt.Wie mache ich das nun bei einem Farbbild ? Muss ich da wirklich pixel für pixel die farbanteile durchgehen? könnte mir vorstellen das dieses zu lange dauert bei großen bildern. vileicht gehts ja auch anderst ?
Gruß
Pre
Wie willst du den Anteil herausbekommen, wenn du nicht jedes Pixel auf den Farbwert prüfst?
Hier muss man mal in GDIp.au3 schauen oder eine schnelle ASM Routine basteln.
Gruß,
UEZ
Eigentlich auch mein Motto: IBM (Immer Besser Manuel) ![]()
Gruß,
UEZ
Hier eine nette Seite, um seine Must Have Apps (Freeware) zu installieren: http://ninite.com/
Gruß,
UEZ
Probiere es mal mit dieser Funktion:
[autoit]
Func __ScreenCapture_CaptureWnd($sFileName, $hWnd, $iLeft = 0, $iTop = 0, $iRight = -1, $iBottom = -1, $maximized = False)
Local $dex = 4, $dey = 1
Local $tRect = _WinAPI_GetWindowRect($hWnd)
If BitAND($maximized, 32) Then
$dex = 8
$dey = 8
EndIf
$iLeft += DllStructGetData($tRect, "Left")
$iTop += DllStructGetData($tRect, "Top")
If $iRight = -1 Then $iRight = DllStructGetData($tRect, "Right") - DllStructGetData($tRect, "Left")
If $iBottom = -1 Then $iBottom = DllStructGetData($tRect, "Bottom") - DllStructGetData($tRect, "Top")
$iRight += DllStructGetData($tRect, "Left")
$iBottom += DllStructGetData($tRect, "Top")
If $iLeft > DllStructGetData($tRect, "Right") Then $iLeft = DllStructGetData($tRect, "Left")
If $iTop > DllStructGetData($tRect, "Bottom") Then $iTop = DllStructGetData($tRect, "Top")
If $iRight > DllStructGetData($tRect, "Right") Then $iRight = DllStructGetData($tRect, "Right")
If $iBottom > DllStructGetData($tRect, "Bottom") Then $iBottom = DllStructGetData($tRect, "Bottom")
Return _ScreenCapture_Capture($sFileName, $iLeft + $dex, $iTop + $dey, $iRight - $dex, $iBottom- $dey, False)
EndFunc ;==>_ScreenCapture_CaptureWnd
Ist aus AutoIt Windows Screenshooter .
Gruß,
UEZ
Seit dem ich Probleme beim Posten im engl. Forum habe, benutze ich Iron für autoitscript.com und autoit.de, auf der Arbeit für Intranetseiten IE9, sonst FF 3/4.
Iron gefällt mir eigentlich ganz gut.
Opera benutze ich so gut wie nie.
Alle Browser, bis auf IE, sind portable Versionen.
Gruß,
UEZ
Java hat einen Vorteil gegenüber C++: es ist Plattform unabhängig, wobei Java ähnliche Syntax hat wie C++.
Ich versuche auch seit einigen Jahren mit C++ anzufangen, aber mir fehlt noch der Einstieg, zumal ich mich an AutoIt sehr gewöhnt habe und keine zeitkritischen Anwendungen schreiben muss.
Viel Spaß mit C++.
Selam,
UEZ
Hier eine UDF zum Beschreiben von Bitmaps.
Die Idee stammt von hier: SaveBitmap.
[autoit]#include-once
#include <GDIPlus.au3>
Opt('MustDeclareVars', 1)
;======================================================================================
; Function Name: _GDIPlus_WTOB (Write Text On Bitmap)
; Description:Loads a bitmap and writes a text on it
;
; Parameters: $sIn:filename of the bitmap or a handle to a bitmap
; $sText:the text which will be written onto the bitmap centered
; Optional:
; $fName:font name to be used
; $fSize:fonst size of the text
;$iX:x position of font - if x and y set $iAlignX and $iAlignY will be skipped
;$iY:y position of font
;$iAlignX:align the font center, left, right (0, 1, 2) on x axis
;$iAlignY:align the font center, top, buttom (0, 1, 2) on y axis
;$iFColor:color of font
;$ebg:enable background black painting to get contrast with font color
; $save:if set to 1 bitmap will be saved
; $sFilename:filename of the save bitmap, if no extension is given PNG will be used instead
; $iJPGQ:jpg image save quality -> 0: worst, 100: best
;$draw_bgrect draws a filled transparent rectangle to make the font better readable
;$iDrawBGRect_c color of filled transparent rectangle
;
; Error codes:
;1: image file not found
;2: no text given
;3: no font given
;4: wrong font size - must be greater then 0
;5: wrong align x value
;6: wrong align y value
;7: unable to create bitmap from scan 0
;8: unable to save image
;
; Requirement(s):GDIplus.au3
; Return Value(s): Success: handle to bitmap, Error: 0
; Author(s):UEZ
; Version:v0.92 Build 2013-02-16 Beta
;=======================================================================================
Func _GDIPlus_WTOB($sIn, $sText, $fName = "Impact", $fSize = 11, $iX = -1, $iY = -1, $iAlignX = 2, $iAlignY = 2, $iFColor = 0xFFFFFFFF, $ebg = True, $save = False, $sFilename = "WTOB.png", $iJPGQ = 90, $draw_bgrect = False, $iDrawBGRect_c = 0xFF808080)
Local $handle = False, $hImage, $declared = True
If IsPtr($sIn) Then $handle = True
If (Not $handle) And ($sIn = "" Or Not FileExists($sIn)) Then Return SetError(1, 0, "File not found")
If $sText = "" Then Return SetError(2, 0, "No text given")
If $fName = "" Then SetError(3, 0, "No font given")
If Not IsInt($fSize) And $fSize > 0 Then Return SetError(4, 0, "Wrong font size")
If $iAlignX < 0 Or $iAlignX > 2 Then Return SetError(5, 0, "Wrong align x value")
If $iAlignY < 0 Or $iAlignY > 2 Then Return SetError(6, 0, "Wrong align y value")
If Not $__g_hGDIPDll Then
_GDIPlus_Startup()
$declared = False
EndIf
If Not $handle Then
$hImage = _GDIPlus_ImageLoadFromFile($sIn)
Else
$hImage = $sIn
EndIf
Local $iW = _GDIPlus_ImageGetWidth($hImage)
Local $iH = _GDIPlus_ImageGetHeight($hImage)
Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH)
If @error Then Return SetError(7, @extended, "Unable to create bitmap from scan 0")
Local $hContext = _GDIPlus_ImageGetGraphicsContext($hBitmap)
_GDIPlus_GraphicsSetSmoothingMode($hContext, 2)
DllCall($__g_hGDIPDll, "int", "GdipSetInterpolationMode", "handle", $hContext, "int", 7)
DllCall($__g_hGDIPDll, "uint", "GdipSetTextRenderingHint", "handle", $hContext, "int", 4)
Local $hPinsel = _GDIPlus_BrushCreateSolid($iFColor)
Local $hFormat = _GDIPlus_StringFormatCreate()
Local $hFamily = _GDIPlus_FontFamilyCreate($fName)
;~ Local $font_size = Floor(($iW - StringLen($sText)) / $fSize)
Local $hFont = _GDIPlus_FontCreate($hFamily, $fSize, 1)
Local $tLayout = _GDIPlus_RectFCreate(0, 0, 0, 0)
Local $aInfo = _GDIPlus_GraphicsMeasureString($hContext, $sText, $hFont, $tLayout, $hFormat)
_GDIPlus_GraphicsDrawImageRect($hContext, $hImage, 0, 0, $iW, $iH)
[/autoit][autoit][/autoit][autoit]Local $fWidth = DllStructGetData($aInfo[0], "Width")
Local $fHeight = DllStructGetData($aInfo[0], "Height")
If $iX < 0 Then
Switch $iAlignX
Case 0 ;alignment center
DllStructSetData($tLayout, "x", $iW / 2 - Round($fWidth / 2, 0))
Case 1 ;alignment left
DllStructSetData($tLayout, "x", 0)
Case 2 ;alignment right
DllStructSetData($tLayout, "x", $iW - $fWidth - 1)
EndSwitch
Else
DllStructSetData($tLayout, "x", $iX)
EndIf
If $iY < 0 Then
Switch $iAlignY
Case 0 ;alignment center
DllStructSetData($tLayout, "y", $iH / 2 - Floor($fHeight / 2))
Case 1 ;alignment top
DllStructSetData($tLayout, "y", 0)
Case 2 ;alignment buttom
DllStructSetData($tLayout, "y", $iH - $fHeight - 1)
EndSwitch
Else
DllStructSetData($tLayout, "y", $iY)
EndIf
Local $hBrush_rect = _GDIPlus_BrushCreateSolid($iDrawBGRect_c)
If $draw_bgrect Then _GDIPlus_GraphicsFillRect($hContext, DllStructGetData($tLayout, "x"), DllStructGetData($tLayout, "y"), $fWidth, $fHeight, $hBrush_rect)
Local $i, $fs = $fSize * 0.075
Local $hBrush_back = _GDIPlus_CreateLineBrush(0, 0, 0, $fSize, 0xFF000000, 0xFF808080)
Local $tLayout2 = _GDIPlus_RectFCreate(0, 0, 0, 0)
DllStructSetData($tLayout2, "Width", $fWidth)
DllStructSetData($tLayout2, "Height", $fHeight)
If $ebg Then
For $i = 0 To 3
Switch $i
Case 0
DllStructSetData($tLayout2, "x", DllStructGetData($tLayout, "x"))
DllStructSetData($tLayout2, "y", DllStructGetData($tLayout, "y") - $fs)
Case 1
DllStructSetData($tLayout2, "x", DllStructGetData($tLayout, "x") + $fs)
DllStructSetData($tLayout2, "y", DllStructGetData($tLayout, "y"))
Case 2
DllStructSetData($tLayout2, "x", DllStructGetData($tLayout, "x"))
DllStructSetData($tLayout2, "y", DllStructGetData($tLayout, "y") + $fs)
Case 3
DllStructSetData($tLayout2, "x", DllStructGetData($tLayout, "x") - $fs)
DllStructSetData($tLayout2, "y", DllStructGetData($tLayout, "y"))
EndSwitch
_GDIPlus_GraphicsDrawStringEx($hContext, $sText, $hFont, $tLayout2, $hFormat, $hBrush_back)
Next
EndIf
_GDIPlus_GraphicsDrawStringEx($hContext, $sText, $hFont, $tLayout, $hFormat, $hPinsel)
_GDIPlus_ImageDispose($hImage)
Local $err = 0
If $save Then
If StringRight($sFilename, 4) = ".jpg" Then
Local $sCLSID = _GDIPlus_EncodersGetCLSID("JPG")
Local $tParams = _GDIPlus_ParamInit(1)
Local $tData = DllStructCreate("int Quality")
DllStructSetData($tData, "Quality", $iJPGQ) ;quality 0-100
Local $pData = DllStructGetPtr($tData)
_GDIPlus_ParamAdd($tParams, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, $pData)
Local $pParams = DllStructGetPtr($tParams)
If Not _GDIPlus_ImageSaveToFileEx($hBitmap, $sFilename, $sCLSID, $pParams) Then $err = 8
$tParams = 0
$tData = 0
Else
If StringMid($sFilename, StringLen($sFilename) - 3, 1) <> "." Then $sFilename &= ".png"
If Not _GDIPlus_ImageSaveToFile($hBitmap, $sFilename) Then $err = 8
EndIf
EndIf
_GDIPlus_FontDispose($hFont)
_GDIPlus_FontFamilyDispose($hFamily)
_GDIPlus_StringFormatDispose($hFormat)
_GDIPlus_BrushDispose($hPinsel)
_GDIPlus_BrushDispose($hBrush_rect)
_GDIPlus_BrushDispose($hBrush_back)
_GDIPlus_GraphicsDispose($hContext)
If Not $declared Then _GDIPlus_Shutdown()
$tLayout = 0
$tLayout2 = 0
Return SetError($err, 0, $hBitmap)
EndFunc ;==>WTOB
Func _GDIPlus_CreateLineBrush($iPoint1X, $iPoint1Y, $iPoint2X, $iPoint2Y, $iArgb1 = 0xFF0000FF, $iArgb2 = 0xFFFF0000, $WrapMode = 1)
Local $tPoint1, $pPoint1, $tPoint2, $pPoint2, $aRet
If $iArgb1 = "" Then $iArgb1 = 0xFF0000FF
If $iArgb2 = "" Then $iArgb2 = 0xFFFF0000
If $WrapMode = -1 Then $WrapMode = 0
$tPoint1 = DllStructCreate("float X;float Y")
$pPoint1 = DllStructGetPtr($tPoint1)
DllStructSetData($tPoint1, "X", $iPoint1X)
DllStructSetData($tPoint1, "Y", $iPoint1Y)
$tPoint2 = DllStructCreate("float X;float Y")
$pPoint2 = DllStructGetPtr($tPoint2)
DllStructSetData($tPoint2, "X", $iPoint2X)
DllStructSetData($tPoint2, "Y", $iPoint2Y)
$aRet = DllCall($__g_hGDIPDll, "int", "GdipCreateLineBrush", "ptr", $pPoint1, "ptr", $pPoint2, "int", $iArgb1, "int", $iArgb2, "int", $WrapMode, "int*", 0)
Return $aRet[6]
EndFunc ;==>_GDIPlus_CreateLineBrush
Gruß,
UEZ
Hier ein Tool von Valik, wie man für 7-Zip die Prozente auslesen kann -> http://www.autoitscript.com/forum/topic/71…__1#entry527810
Vielleicht kann man das auch für unrar.exe umsetzen oder du verwendest 7-Zip für das Entpacken.
Gruß,
UEZ
Probiere es mal mit ChrW():
[autoit]
#include <GUIConstantsEx.au3>
$hGUI = GUICreate("Test", 320, 256)
$label = GUICtrlCreateLabel("Test â–º " & ChrW(8658), 100, 100)
GUISetState()
While True
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Gruß,
UEZ
Probiert mal dies:
If @OSArch = "X86" Then
$DigitalProductId = RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\", "DigitalProductId")
Else
$DigitalProductId = RegRead("HKLM64\SOFTWARE\Microsoft\Windows NT\CurrentVersion\", "DigitalProductId")
EndIf
MsgBox(0, "Decode Product Key", _DecodeProductKey($DigitalProductId))
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]Func _DecodeProductKey($BinaryDPID)
Local $bKey[15]
Local $sKey[29]
Local $Digits[24]
Local $Value = 0
Local $hi = 0
Local $n = 0
Local $i = 0
Local $dlen = 29
Local $slen = 15
Local $Result
$Digits = StringSplit("BCDFGHJKMPQRTVWXY2346789", "")
[/autoit] [autoit][/autoit] [autoit]$BinaryDPID = StringMid($BinaryDPID, 107, 30)
[/autoit] [autoit][/autoit] [autoit]For $i = 1 To 29 Step 2
$bKey[Int($i / 2)] = Dec(StringMid($BinaryDPID, $i, 2))
Next
For $i = $dlen - 1 To 0 Step -1
If Mod(($i + 1), 6) = 0 Then
$sKey[$i] = "-"
Else
$hi = 0
For $n = $slen - 1 To 0 Step -1
$Value = BitOR(BitShift($hi, -8), $bKey[$n])
$bKey[$n] = Int($Value / 24)
$hi = Mod($Value, 24)
Next
$sKey[$i] = $Digits[$hi + 1]
EndIf
Next
For $i = 0 To 28
$Result = $Result & $sKey[$i]
Next
Return $Result
EndFunc ;==>DecodeProductKey
Gruß,
UEZ
und gleich noch eine frage im anschluss: könnte man den code auch so verändern das wenn eine seite > 8192 ist, erst von 0 bis 8192 ge-screent wird, zwischengelagert, dann von 8192 bis ende (bzw. bis 16.384)... u.s.w. und dann die teile per gdi+ zusammenfügt zu einem bild?
Sowas ähnliches hat Eukalyptus bereits gemacht (siehe Post#10). Aber ich werde es auch mal bei Gelegenheit probieren..
Warum das Limit bei 8192 = 2^13 = 0x2000 = 10000000000000 ist, weiß wohl MS am besten. Ich bin mal gespannt, was es noch für Probleme mit den IE Funktionen in AutoIt bzgl. IE9 geben wird.
Gruß,
UEZ
Hmmm, warum plötzlich die Beschränkung auf 8192? ![]()
Aber egal, jetzt weiß ich es ja ![]()
Danke andygo!
Habe den Code aktualisiert.
Gruß,
UEZ
Ich habe vorgestern IE9 installiert und nun wird z.B. https://autoit.de/www.stern.de nur weiß gerendert, wobei beim ersten Rendern die Seite noch angezeigt wird.
Beim ersten Rendern wird die Höhe des Fensters ermittelt, die dann beim zweiten Rendern benutzt wird, um den Screenshot von der Webseite zu erstellen.
Hat jemand eine Idee, warum das jetzt so ist bzw. kann jemand das mal testen (mit IE9 und Aero!), ob das Fenster auch weiß bleibt? Der Screenshot wird in den Clipboard geschickt.
Der Code ist im ersten Post!
Gruß,
UEZ
Hatte ich vergessen zu posten:
;coded by UEZ 2011-03-16
#include <GDIPlus.au3>
Opt("GUIOnEventMode", 1)
_GDIPlus_Startup ()
$hImage = _GDIPlus_ImageLoadFromFile("..\..\Images\earth_small2.bmp")
If Not $hImage Then
_GDIPlus_Shutdown()
Exit
EndIf
$iW = _GDIPlus_ImageGetWidth($hImage)
$iH = _GDIPlus_ImageGetHeight($hImage)
$hGUI = GUICreate("GDI+ Test", $iW, $iH)
GUISetState()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
$hBitmap = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $hGraphic)
$hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
$hBrush = _GDIPlus_BrushCreateSolid(0)
$b = 1 + Floor($iW / 5)
$x = -$b
$hScannerBitmap = _GDIPlus_BitmapCreateFromGraphics($b, $iH, $hGraphic)
$hContext = _GDIPlus_ImageGetGraphicsContext($hScannerBitmap)
$alpha_start = 0x04
$alpha_end = 0xD0
$alpha_steps = ($alpha_end - $alpha_start) / $b
$alpha = $alpha_start
For $i = 0 To $b
$alpha += $alpha_steps
_GDIPlus_BrushSetSolidColor($hBrush, "0x" & Hex($alpha, 2) & "00FF00")
_GDIPlus_GraphicsFillRect($hContext, $i, 0, 1, $iH, $hBrush)
Next
GUISetOnEvent(-3, "_Exit")
While Sleep(20)
If Mod($x + $b, 30) < 15 Then
WinSetTitle($hGUI, "", "Scanning ...")
Else
WinSetTitle($hGUI, "", "")
EndIf
_GDIPlus_GraphicsDrawImageRect($hBackbuffer, $hImage, 0, 0, $iW, $iH)
_GDIPlus_GraphicsDrawImageRect($hBackbuffer, $hScannerBitmap, $x, 0, $b, $iH)
$x += 1
If $x > $iW + $b Then $x = -$b
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, $iW, $iH)
WEnd
Func _Exit()
_GDIPlus_BrushDispose($hBrush)
_GDIPlus_BitmapDispose ($hScannerBitmap)
_GDIPlus_BitmapDispose ($hBitmap)
_GDIPlus_GraphicsDispose($hContext)
_GDIPlus_GraphicsDispose($hBackbuffer)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_ImageDispose($hImage)
_GDIPlus_Shutdown()
Exit
EndFunc
Gruß,
UEZ
Schaue dir doch mal die Physik Engine2 von Moritz1243 an!
Gruß,
UEZ
Vielleicht mein progandy sowas:
#include <FileConstants.au3>
#include <Array.au3>
$run = FileBinReplace("ap.txt", "3030", "7878") ;suche nach Hex 3030 und ersetze es mit Hex 7878 -> 00->xx
ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $run = ' & $run & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
Func FileBinReplace($filename, $search, $replace) ;coded by UEZ build 2011-03-15 ßeta
If $filename = "" Then Return SetError(1, 0, 0)
If Not FileExists($filename) Then Return SetError(2, 0, 0)
If $search = "" Or $replace = "" Then Return SetError(3, 0, 0)
Local $data
If Mod(StringLen($search), 2) = 1 Then $search = "0" & $search
If Mod(StringLen($replace), 2) = 1 Then $replace = "0" & $replace
If StringLen($search) <> StringLen($replace) Then Return SetError(4, 0, 0)
Local $aTokens = StringRegExp($search, ".{2}", 3)
If Not IsArray($aTokens) Then Return SetError(5, 0, 0)
Local $len = UBound($aTokens)
Local $flen = FileGetSize($filename)
If @error Or $flen = 0 Then Return SetError(6, 0, 0)
Local $hFile = FileOpen($filename, 16 + 1)
If @error Then Return SetError(7, 0, 0)
Local $pos = 0, $i = 0, $old_pos = 0, $c = 0
While $pos < $flen + 1
$old_pos = $pos
While $i < $len
FileSetPos($hFile, $pos, $FILE_BEGIN)
If "0x" & $aTokens[$i] <> FileRead($hFile, 1) Then ExitLoop
$pos += 1
$i += 1
WEnd
If $i = $len Then
FileSetPos($hFile, $old_pos, $FILE_BEGIN)
FileWrite($hFile, "0x" & $replace)
$pos += $len - $i
$c += 1
Else
$pos += 1
EndIf
$i = 0
WEnd
FileFlush($hFile)
FileClose($hFile)
Return SetError(0, 0, $c)
EndFunc
Keine Ahnung, ob das schneller oder besser ist - ist einfach nur ein Konzept Code.
Gruß,
UEZ