My god, This argument has been for several days. However, it does not hold water! see follow example!
#include <GDIPlus.au3>
_GDIPlus_Startup()
; Create a bitmap
$hBitmap = DllCall($ghGDIPDll,"uint","GdipCreateBitmapFromScan0","int",100,"int",100,"int",0,"int",$GDIP_PXF32ARGB,"ptr",0,"int*",0)
$hContext = _GDIPlus_ImageGetGraphicsContext($hBitmap[6])
; Set pixels color 0xFCFF0000
_GDIPlus_GraphicsClear($hContext,0xFCFF0000)
; In this phase the color is 0xFCFE0000
ConsoleWrite(GetPixel($hBitmap[6],10,10) & @CRLF)
; Set Pixel(10,10) color: 0xFCFF0000
DllCall($ghGDIPDll,"int","GdipBitmapSetPixel","handle",$hBitmap[6],"int",10,"int",10,"dword",0xFCFF0000)
; In this phase the color is 0xFCFF0000
ConsoleWrite(GetPixel($hBitmap[6],10,10) & @CRLF)
; Clean up resources
_GDIPlus_GraphicsDispose($hContext)
_GDIPlus_BitmapDispose($hBitmap[6])
_GDIPlus_Shutdown()
Func GetPixel($hBitmap,$X,$Y)
Local $tPixel = DllStructCreate("dword Pixel")
DllCall($ghGDIPDll,"int","GdipBitmapGetPixel","handle",$hBitmap,"int",$X,"int",$Y,"ptr",DllStructGetPtr($tPixel))
Return Hex(DllStructGetData($tPixel,"Pixel"),8)
EndFunc
|