Hallo CentuCore.
Danke für deinen Tipp mit bisschen Rumprobieren habe ich es nun hinbekommen musste noch Width und Height umdrehen das zuerst Height und dann Width in der Schleife kommt da es sonst die Farben zusammengewürfelt hatte...
Ob Mono funktioniert kann ich leider nicht sagen da ich keine Tastatur zum Testen habe.
Spoiler anzeigen
AutoIt
; ###################################################################################################################################
; Beschreibung .................: _LogitechGaming_LCD_SetBackground
; ###################################################################################################################################
; Parameters ...................: $LCDSetBackground_LCDOpen = [REQ] Rückgabewert von _LogitechGaming_LCD_Open.
; $LCDSetBackground_BitmapFile = [REQ] Pfad zu der Bilddatei.
; $LCDSetBackground_LCDType = [OPT] Der Typ des Displays ($_LGLCD_TypeColor | $_LGLCD_TypeMono).
; ###################################################################################################################################
; Rückgabewerte ................: 1 = Der Befehl zum ändern der Hintergrundfarbe wurde erfolgreich ausgeführt.
; 0 = Der Befehl zum ändern der Hintergrundfarbe wurde nicht erfolgreich ausgeführt.
; -1 = Die dll wurde bereits geschlossen oder nicht geladen.
; -2 = Es wurde kein gültiger LCD Display Type angegeben.
; -3 = Das Bild konnte nicht in GDIPlus geladen werden.
; -4 = Die Dimensionen des Bildes stimmen nicht.
; ###################################################################################################################################
Func _LogitechGaming_LCD_SetBackground ($LCDSetBackground_LCDOpen, $LCDSetBackground_BitmapFile, $LCDSetBackground_LCDType = $_LGLCD_TypeColor)
If $LCDSetBackground_LCDOpen = "" Or $LCDSetBackground_LCDOpen = "-1" Or $LCDSetBackground_LCDOpen = "-2" Then Return "-1"
If $LCDSetBackground_LCDType = $_LGLCD_TypeColor Then
_GDIPlus_Startup ()
$LCDSetBackground_GDIPBCFF = _GDIPlus_BitmapCreateFromFile ($LCDSetBackground_BitmapFile)
If $LCDSetBackground_GDIPBCFF = 0 Then Return "-3"
$LCDSetBackground_GDIPIGW = _GDIPlus_ImageGetWidth ($LCDSetBackground_GDIPBCFF)
$LCDSetBackground_GDIPIGH = _GDIPlus_ImageGetHeight ($LCDSetBackground_GDIPBCFF)
If Not ($LCDSetBackground_GDIPIGW = $_LGLCD_TypeColorWidth) Or Not ($LCDSetBackground_GDIPIGH = $_LGLCD_TypeColorHeight) Then Return "-4"
$LCDSetBackground_Number = 1
$LCDSetBackground_DllStructCreate = DllStructCreate ('DWORD pixels[' & $_LGLCD_TypeColorWidth * $_LGLCD_TypeColorHeight & ']')
For $LCDSetBackground_ForNextH = 1 To $_LGLCD_TypeColorHeight Step 1
For $LCDSetBackground_ForNextW = 1 To $_LGLCD_TypeColorWidth Step 1
DllStructSetData ($LCDSetBackground_DllStructCreate, "pixels", _GDIPlus_BitmapGetPixel ($LCDSetBackground_GDIPBCFF, $LCDSetBackground_ForNextW, $LCDSetBackground_ForNextH), $LCDSetBackground_Number)
$LCDSetBackground_Number += 1
Next
Next
$LCDSetBackground_DllCall = DllCall ($LCDSetBackground_LCDOpen, "bool:cdecl", "LogiLcdColorSetBackground", "STRUCT*", DllStructGetPtr ($LCDSetBackground_DllStructCreate, "pixels"))
$LCDSetBackground_DllStructCreate = ""
_GDIPlus_Shutdown ()
ElseIf $LCDSetBackground_LCDType = $_LGLCD_TypeMono Then
_GDIPlus_Startup ()
$LCDSetBackground_GDIPBCFF = _GDIPlus_BitmapCreateFromFile ($LCDSetBackground_BitmapFile)
If $LCDSetBackground_GDIPBCFF = 0 Then Return "-3"
$LCDSetBackground_GDIPIGW = _GDIPlus_ImageGetWidth ($LCDSetBackground_GDIPBCFF)
$LCDSetBackground_GDIPIGH = _GDIPlus_ImageGetHeight ($LCDSetBackground_GDIPBCFF)
If Not ($LCDSetBackground_GDIPIGW = $_LGLCD_TypeMonoWidth) Or Not ($LCDSetBackground_GDIPIGH = $_LGLCD_TypeMonoHeight) Then Return "-4"
$LCDSetBackground_Number = 1
$LCDSetBackground_DllStructCreate = DllStructCreate ('DWORD pixels[' & $LCDSetBackground_GDIPIGH * $_LGLCD_TypeMonoHeight & ']')
For $LCDSetBackground_ForNextH = 1 To $_LGLCD_TypeMonoHeight Step 1
For $LCDSetBackground_ForNextW = 1 To $LCDSetBackground_GDIPIGH Step 1
DllStructSetData ($LCDSetBackground_DllStructCreate, "pixels", _GDIPlus_BitmapGetPixel ($LCDSetBackground_GDIPBCFF, $LCDSetBackground_ForNextW, $LCDSetBackground_ForNextH), $LCDSetBackground_Number)
$LCDSetBackground_Number += 1
Next
Next
$LCDSetBackground_DllCall = DllCall ($LCDSetBackground_LCDOpen, "bool:cdecl", "LogiLcdMonoSetBackground", "STRUCT*", DllStructGetPtr ($LCDSetBackground_DllStructCreate, "pixels"))
$LCDSetBackground_DllStructCreate = ""
_GDIPlus_Shutdown ()
Else
Return "-2"
EndIf
If IsArray ($LCDSetBackground_DllCall) Then Return $LCDSetBackground_DllCall[0]
Return $LCDSetBackground_DllCall
EndFunc
Alles anzeigen
Ich sage mal Danke für die schnelle und nette Hilfe ( @CentuCore)