[commit: packages/Win32] depend-os-windows, fix-appveyor-curl-ussue, master, win32-2.5.4.1-ghc-8.2: Add getpixel (#37) (b80b6bd)

git at git.haskell.org git at git.haskell.org
Mon Apr 17 21:28:42 UTC 2017


Repository : ssh://git@git.haskell.org/Win32

On branches: depend-os-windows,fix-appveyor-curl-ussue,master,win32-2.5.4.1-ghc-8.2
Link       : http://git.haskell.org/packages/Win32.git/commitdiff/b80b6bd4eb0da179a00e102ec508b0e975cf69b9

>---------------------------------------------------------------

commit b80b6bd4eb0da179a00e102ec508b0e975cf69b9
Author: ralphmorton <ralph at teamcanopy.com>
Date:   Mon Mar 13 23:58:41 2017 +0200

    Add getpixel (#37)


>---------------------------------------------------------------

b80b6bd4eb0da179a00e102ec508b0e975cf69b9
 Graphics/Win32/GDI/HDC.hs | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/Graphics/Win32/GDI/HDC.hs b/Graphics/Win32/GDI/HDC.hs
index bee7572..0ed398e 100644
--- a/Graphics/Win32/GDI/HDC.hs
+++ b/Graphics/Win32/GDI/HDC.hs
@@ -43,6 +43,17 @@ efficient (fromIntegral is optimized away,) and conveys the idea we
 simply want the same representational value.
 -}
 
+----------------------
+-- Implement GetPixel
+----------------------
+
+getPixel :: HDC -> Int -> Int -> IO COLORREF
+getPixel dc x y = c_GetPixel dc x y
+foreign import WINDOWS_CCONV unsafe "windows.h GetPixel"
+  c_GetPixel :: HDC -> Int -> Int -> IO COLORREF
+
+----------------------
+
 setArcDirection :: HDC -> ArcDirection -> IO ArcDirection
 setArcDirection dc dir =
   failIfZero "SetArcDirection" $ c_SetArcDirection dc dir



More information about the ghc-commits mailing list