Jump to content
Sign in to follow this  
mhhhPizza

coordinates of image

Recommended Posts

mhhhPizza

Hello world ;)

perhaps you guys know how to deal with my problem.

I need the coordinates of the upper left corner of a image displayed in my embedded IE.

Is there any possibility to solve that?

Thanks in advance for your efforts.

One of those guys who like pizza ^_^

Share this post


Link to post
Share on other sites
herewasplato

Welcome to the forum.

Look in the help file under PixelSearch and/or PixelChecksum.


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites
mhhhPizza

First, thanks for your answer. One problem is that the image´s upper left pixel is a black one (actually, the image´s edges are a black lines of 1px) and there is some text (which is black, too) before that image (Or imagine if the image´s upper left pixel is transparent, I don´t think pixelsearch would work then.). if I now try to look for the first black pixel, I get anything but the pixel I´m looking for ^_^

The other problem is that I expect it to take a long time to search an area of about 600*600 px ...

I hope there are other suggestions.

Edited by mhhhPizza

Share this post


Link to post
Share on other sites
herewasplato

Since a pic is worth 1k words - either write a whole bunch more or show a screen shot. :-)

Guessing here: Anything unique inside the pic? If so, maybe you can locate that via PixelSearch and then search from there. And/or PixelChecksum can be shaped like a thin rectangle loop/sweep it across an area to find an edge that is not text.

Slow/speed is relative. What is this for - a game?


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites
Malkey

Hello world :)

perhaps you guys know how to deal with my problem.

I need the coordinates of the upper left corner of a image displayed in my embedded IE.

Is there any possibility to solve that?

Thanks in advance for your efforts.

One of those guys who like pizza :whistle:

I have no idea if this approach will work in an embedded IE.

It works in the IE browser. (Modified help file example)

;
; *******************************************************
; Example 2 - Create browser at AutoIt homepage, get Img collection
;               and display src URL for each
; *******************************************************
;
#include <IE.au3>
$oIE = _IECreate("http://www.autoitscript.com/")
$oImgs = _IEImgGetCollection($oIE)
$iNumImg = @extended
MsgBox(0, "Img Info", "There are " & $iNumImg & " images on the page")

For $oImg In $oImgs
    MsgBox(0, "Img Info", "src=" & $oImg.src & @CR & _
            "FileName: " & $oImg.nameProp & @CR & _
            "x-coordinate of the top left corner: " & _IEPropertyGet($oImg, "browserx") & @CR & _
            "y-coordinate of the top left corner: " & _IEPropertyGet($oImg, "browsery") & @CR & _
            "Width: " & $oImg.width & @CR & _
            "Height: " & $oImg.height & @CR & _
            "Border: " & $oImg.border)
Next
;
I hope this will help.

Share this post


Link to post
Share on other sites
DaleHohm

_IEPropertyGet with browserX|browserY|screenX|screenY

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites
was

show how the pic looks like

Share this post


Link to post
Share on other sites
mhhhPizza

Great! Works exactly the way I wanted it!

Thank you very very much!

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  

×