Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <GDIPlus.au3>
- $Path = "Path.jpg" ;Bildpfad
- ImagePixelToArray($Path)
- Func ImagePixelToArray($Path)
- _GDIPlus_Startup()
- $hBitmap = _GDIPlus_BitmapCreateFromFile($Path)
- $iX = _GDIPlus_ImageGetWidth($hBitmap)
- $iY = _GDIPlus_ImageGetHeight($hBitmap)
- ConsoleWrite("X:" & $iX & " - Y:" & $iY & @CRLF)
- Dim $Pixel[$iX][$iY]
- For $i1 = 1 To $iX
- For $i2 = 1 To $iY
- $Pixel[$i1][$i2] = Hex(_GDIPlus_GetPixel($hBitmap, $i2, $i1))
- ConsoleWrite("Color:" & Hex(_GDIPlus_GetPixel($hBitmap, $i2, $i1)) & @CRLF)
- Next
- Next
- _GDIPlus_BitmapDispose($hBitmap)
- _GDIPlus_Shutdown()
- Return $Pixel
- EndFunc ;==>ImagePixelToArray
- Func _GDIPlus_GetPixel($hBitmap, $X, $Y)
- ; Prog@ndy
- Local $result = DllCall($ghGDIPDLL, "int", "GdipBitmapGetPixel", "ptr", $hBitmap, "int", $X, "int", $Y, "dword*", 0)
- If @error Then Return SetError(1, 0, 0)
- Return SetError($result[0], 1, $result[4])
- EndFunc ;==>_GDIPlus_GetPixel
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement