GDIPlus _BitmapSetPixel ( $hBitmap, $x, $y, 0xFF0000FF ) Next Next _GDIPlus_GraphicsDrawImage ( $hGraphic, $hBitmap, 0, 0 ) Using gdi32.dll GetPixel Used in forums search GetPixel $aRet = DllCall ( "gdi32.dll", "int", "GetPixel", "hwnd", $hDC, "int", 100, "int", 100 ) ConsoleWrite ( "GetPixel = 0x" & Hex ( $aRet, 6 ) & ) Using GDI+ BitmapGetPixel $iArgb = GDIPlus _BitmapGetPixel ( $hBitmap, 100, 100 ) ConsoleWrite ( "$iArgb = " & $iArgb & ) Using gdi32.dll SetPixel For $x = 5 To 15 For $y = 5 To 35 Expand collapse popup #include #include #include Opt ( 'MustDeclareVars', 1 ) _Main ( ) Func _Main ( ) Local $hGUI, $hBMP, $hBitmap, $hGraphic, $hDC, $aRet, $iArgb Capture upper left corner of screen $hBMP = _ScreenCapture_Capture ( "", 0, 0, 400, 300 ) Create GUI $hGUI = GUICreate ( "GDI+", 400, 300 ) GUISetState ( ) Initialize GDI+ library _GDIPlus_Startup ( ) $hDC = _WinAPI_GetDC ( $hGUI ) Draw bitmap to GUI $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP ( $hBMP ) $hGraphic = _GDIPlus_GraphicsCreateFromHWND ( $hGUI ) Using GDI+ BitmapSetPixel For $x = 25 To 45 For $y = 5 To 55
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |