gczobel Posted May 9, 2008 Posted May 9, 2008 Hi! Suppose that I have a bitmap on the clipboard and I obtain a handle to it: $hBitmap = _ClipBoard_GetData($CF_BITMAP) I want to check some pixels on the bitmap. There is any way to obtain a DeviceContext in order to call "SelectObject" then "GetPixel" ?? Thanks in advance!
Kip Posted May 12, 2008 Posted May 12, 2008 good question MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API.
ProgAndy Posted May 12, 2008 Posted May 12, 2008 I think this way $DeskDC = _WinAPI_GetDC(0) $UseDC = _WinAPI_CreateCompatibleDC($DeskDC) _WinAPI_ReleaseDC($DeskDC) _WinAPI_SelectObject($UseDC,$hBitmap) *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
gczobel Posted May 13, 2008 Author Posted May 13, 2008 Thanks!!! Work perfect. I add a little example: if _ClipBoard_IsFormatAvailable($CF_BITMAP) = False Then Exit(1) EndIf $hBitmap = _ClipBoard_GetData($CF_BITMAP) $DeskDC = _WinAPI_GetDC(0) $UseDC = _WinAPI_CreateCompatibleDC($DeskDC) _WinAPI_ReleaseDC(0, $DeskDC) _WinAPI_SelectObject($UseDC,$hBitmap) Local $Color = DLLCall("gdi32.dll","int","GetPixel","int",$UseDC ,"int",100,"int",100) MsgBox(0,"Color", Hex($Color[0],6) ) _WinAPI_DeleteDC($UseDC) _ScreenCapture_SaveImage('c:\Screen.bmp', $hBitmap, True)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now