Jump to content
Sign in to follow this  
solidacid

1x1 pixel screenshot?

Recommended Posts

solidacid

hey.

i have an application that i need to get a 1x1 pixel screenshot of at certain coordinates.

then i need to get the color of the screenshot(put it in a picturebox and use pixelgetcolor?)

i CAN'T use pixelgetcolor() directly on the form.

i tried:

#include <ScreenCapture.au3>
HotKeySet("{ESC}", "Terminate")
Opt("MouseCoordMode", 0)
WinActivate("Diablo II")
mousemove(1,1)
WinSetOnTop("Diablo II", "Diablo II", 1)
func terminate()
    exit 0
endfunc
_Main()

Func _Main()
    Local $hGUI
$winhandle = WinGetHandle("Diablo II")
$bmphandle = _ScreenCapture_CaptureWnd (-1, $winhandle)
msgbox(0, "blahh", $winhandle & " & " & $bmphandle)
    ; Create GUI
    $hGUI = GUICreate("Screen Capture", 400, 300)
    $pic = GUICtrlCreatePic($bmphandle, 0,0,100,100)
    GUISetState()
    
    ; Capture window
    

EndFunc   ;==>_Main
while 1
    
wend

but that didnt work.

any ideas?

Share this post


Link to post
Share on other sites
weaponx

Ummm I hate to tell you but a 1x1 screenshot is the same thing as PixelGetcolor...

Share this post


Link to post
Share on other sites
yyyy273

Take a look at ImageMagick if you have to use a 1x1 screenshot

Specifically, look up crop and histogram

Share this post


Link to post
Share on other sites
weaponx

So why can't you use PixelGetColor? Is it not returning anything?

Share this post


Link to post
Share on other sites
solidacid

So why can't you use PixelGetColor? Is it not returning anything?

when i use pixelgetcolor() it returns the wrong color.

when i hold the mouse over a big red blob it outputs green, if i move it a pixel it shows blue, back to the first pixel and it's black.

i think the game is using some kind of layers for drawing.

the game is Diablo II:Lord of destruction

i tried taking a screenshot and paste it in paint, then pixelgetcolor() returns the right color

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×