GPC_Color = 0x3444b0 GPC_X1 = 100 GPC_X2 = 150 GPC_Y1 = 100 GPC_Y2 = 150 Gosub GetPixelCount if PixelCount > 7 { ... } return GetPixelCount: PixelCount = 0 GPC_X = %GPC_X1% Loop { if GPC_X > %GPC_X2% break GPC_Y = %GPC_Y1% Loop { if GPC_Y > %GPC_Y2% break PixelGetColor, GPC_ColorTemp, %GPC_X%, %GPC_Y% if GPC_ColorTemp = %GPC_Color% ++PixelCount ++GPC_Y } ++GPC_X } return
Get pixel count for specified region & color
Started by
Chris
, Sep 11 2004 11:47 AM
1 reply to this topic
This small subroutine might be useful to someone. It retrieves the number of pixels in a region that match a certain color:
#1
-
Posted 11 September 2004 - 11:47 AM
Is there any way to get a complete list of hex colors of a specified region?
i.e. I am looking to differentiate between a certain shade of red and blue, but red is not the majority color (and thus there are many many colors to try when i use your subroutine)
Thanks!
Um... if you could take a look at the topic labeled
Image Search Fails to recognize screenshot if trigger (game)
http://www.autohotke...pic.php?t=29258
Would be much appreciated. An expert could tell me what im doing wrong in a few secs im sure.
i.e. I am looking to differentiate between a certain shade of red and blue, but red is not the majority color (and thus there are many many colors to try when i use your subroutine)
Thanks!
Um... if you could take a look at the topic labeled
Image Search Fails to recognize screenshot if trigger (game)
http://www.autohotke...pic.php?t=29258
Would be much appreciated. An expert could tell me what im doing wrong in a few secs im sure.
#2
-
Posted 03 March 2008 - 02:21 PM