Jump to content

Recommended Posts

  • Moderators
Posted
  On 1/17/2014 at 2:24 PM, trancexx said:

Would you stop trolling, the guy already said what's it about.

 

How is this kind of post anything but trolling?

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Posted
  On 1/17/2014 at 6:57 AM, Xibalba said:

My endgame is live Picture- and Video-analysis and manipulation - so speed is of most importance.

Rest assured though, it's not against any of the forum rules.

If anyone know the GDIPlus equivalent to PixelGetColor(), with a minimalistic example using what is currently shown on the screen, I'd be very grateful.

Thx

Would that not just be a call to GetPixel()

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

  • Moderators
Posted

I did read it, just don't see the point of mewling about it :)

 

BTW - "Cursing is the last vestige of the small minded"

Or - "Prestani kukati i jebanja." if you prefer :)

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

  • Moderators
Posted

trancexx,

You make pointed comments like that - you can expect to get pointed responses. ;)

And please moderate your language in future - there is absoutely no need to use such terms in a programming forum. :naughty:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted

Oh, isn't that absolutely lovely. Go away.

 

 

@Xibalba, gdip solution could be suggested GetPixel(), which written in AutoIt using flat API would be (pay attention that you get ARGB value):

Func GdipBitmapGetPixel($pBitmap, $iX, $iY)
    Local $aCall = DllCall($ghGDIPDll, "long", "GdipBitmapGetPixel", _ ; uses internal _GDIPlus dll handle
            "ptr", $pBitmap, _
            "long", $iX, _
            "long", $iY, _
            "dword*", 0)
    If @error Or $aCall[0] Then Return SetError(1, 0, 0)
    Return $aCall[4] ; ARGB
EndFunc
Latest standard GDIPlus.au3 has this function also, it's called _GDIPlus_BitmapGetPixel().

 

Just to show that it works here's small example of drawing section of screen using absolutely dumb method of colored labels which rapes the AutoIt GUI feature:

#include <GDIPlus.au3>
#include <ScreenCapture.au3>

_GDIPlus_Startup()

Global $hBMP = _ScreenCapture_Capture("")
Global $pBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hBMP)

; Display 100 X 150 region of screen with pixel size of 2 (granulation)
CreateGUI_Thing($pBitmap, 100, 150, 2)


_GDIPlus_BitmapDispose($pBitmap)
_WinAPI_DeleteObject($hBMP)

_GDIPlus_Shutdown()



Func CreateGUI_Thing($pBitmap, $iX_Size, $iY_Size, $iPixelSize)
    GUICreate("My Super Duper Capture", $iX_Size + 20, $iY_Size + 20)

    ; Draw little labels colored based on pixel color of the gdip bitmap
    Local $iColor
    For $i = 1 To $iX_Size Step $iPixelSize
        For $j = 1 To $iY_Size Step $iPixelSize
            $iColor = BitAND(_GDIPlus_BitmapGetPixel($pBitmap, $i, $j), 0xFFFFFF) ; RGB portion of the color extracted
            GUICtrlCreateLabel("", 10 + $i, 10 + $j, $iPixelSize, $iPixelSize)
            GUICtrlSetBkColor(-1, $iColor)
        Next
    Next

    GUISetState(@SW_SHOW)
    While 1
        If GUIGetMsg() = -3 Then ExitLoop
    WEnd
    GUIDelete()
EndFunc
So the idea would be to capture the screen into bitmap object and read pixel from that. I'm not sure that's the best idea because screen capturing takes time also.

♡♡♡

.

eMyvnE

  • Moderators
Posted

trancexx,

  Quote

Oh, isn't that absolutely lovely. Go away.

Absolutely no chance. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted

  On 1/17/2014 at 8:21 PM, Melba23 said:

trancexx,

Absolutely no chance. ;)

M23

I hope you aren't stalking me again. I told you last time that you scare me when you do that. Just don't :).

♡♡♡

.

eMyvnE

  • Moderators
Posted

trancexx,

You flatter yourself - nothing would please me more than never having to have anything to do with you ever again. So you stop causing me to be called into threads to moderate and then I will have no reason to be there. Your choice. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

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
×
×
  • Create New...