Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 06:23

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[VB]Get position of image on screen

Discussion on [VB]Get position of image on screen within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jun 2012
Posts: 7
Received Thanks: 0
[VB]Get position of image on screen

Hello, please I need your help. I'm trying to get X and Y of image on screen. I know, I must make screenshot and search image (I have image that I'm trying to get location in Resources), but I don't know, how to search it. Can anyone help me? Thanks advance

I have done it! :P
Growec is offline  
Old 12/22/2013, 13:16   #2
 
MrDami123's Avatar
 
elite*gold: 56
Join Date: Oct 2010
Posts: 3,409
Received Thanks: 1,219
When you have the image, you need to get the size and then you can calculate the position you need.
When you have always the same imagesize, you could say the programm to choose a spezific area, but I don't recommend it.

MrDami123 is offline  
Old 12/22/2013, 13:59   #3
 
'Heaven.'s Avatar
 
elite*gold: 1
The Black Market: 331/0/0
Join Date: Jun 2012
Posts: 5,819
Received Thanks: 3,200
'Heaven. is offline  
Old 12/22/2013, 18:06   #4
 
elite*gold: 0
Join Date: Aug 2011
Posts: 159
Received Thanks: 57
One solution(?)

Ey,

Here is one fastly and not-tested code file:
First I dont remember is it (x,y) or (y,x). So thats might be the first one which causes problems

Code:
private function find_pixel (pic as bitmap, pic2 as bitmap) as string 
pic = 'image where u want to search another picture'
pic2 = 'image you are finding from pic'
Dim pixelCol as color 

for x = 0 to pic.width -1
	for y=0 to pic.height -1
		PixelCol = pic.getPixel(y,x) 'or (x,y) I dont remember..'
		
		if PixelCol = pic2.getPixel(0,0) then 'first pixel is 100% same color'
			'now depend on image size and what u want to do but there is one solution (to check whole image):'
				for i=0 to pic2.width - 1
					for j=0 to pic2.height -1
						if pic.getPixel(y+j, x+i) = pic2.getPixel(i,j) then
						'match -> lets check next pixel'
						else
						'not same image'
						next y 
						exit for 'exit for j'
						end if 
						
						Return y,x 'or (y+j, x+i) or what pixel u want? first is starting pixel and secong last pixel'
					next j
				next i
		end if 
		
	next y
next x

end function
The above is ok for smaller images but its a bit slow. To do the same faster, take a look:
BeginnerDO is offline  
Reply

Tags
location, pixel, position, vb


Similar Threads Similar Threads
[C#] Position eines Image in Screen suchen
06/11/2013 - .NET Languages - 0 Replies
Hallo, ich suche eine Methode, die in einem Screenshot nach einem bestimmten Bild sucht, welches im Programm hinterlegt ist. Die Methode soll dann die Koordinaten ausgeben, wo sich das Template Image im Source Image befindet. Natürlich hab ich versucht mich dazu schon etwas zu erkundigen und bin im Internet auf einen Code, basierend auf der AForge.net Libary, gestoßen, welcher jedoch bei mir nicht funktioniert und das Programm zum Absturz bringt: System.Drawing.Bitmap sourceImage =...
Image on the screen
07/09/2012 - AutoIt - 2 Replies
Hello ppls. Is it possible,in autoit,to dont make anything only an transparent background image somewhere on the screen,like a "+" or something?? If yes,please,tell me how. And to make the script to be ALWAYS ON TOP???
[VB.NET] Image From Screen?
03/20/2012 - .NET Languages - 2 Replies
Hey, Is there any understandable way to found image X from screen? For example if I have set image X as elitepvpers logo. I come to this site and click "find" button -> msgbox("imagefound" + image.size + image.location....). This above is the main question but if someone knows how to draw perfectly to screen it would be nice to know. I know how to draw dot, squares, etc but they stay on screen just until I draw other window above them. (=how to get them to stay on screen (topmost) even...
Dibiase - New Sig/Full Size Image - [GIANT IMAGE WARNING]
10/26/2011 - General Art - 1 Replies
WARNING - SOME OF THESE IMAGES ARE MASSIVE(OVER 2000 PIXELS WIDE/1000 PIXELS HIGH). This is my latest signature collection, the full size images show the detail. Full-Size: http://img339.imageshack.us/img339/971/dibiaseful l.png Super-Sized:
[Request][Help] Moving clients to position on screen (right-top corner)
02/02/2010 - CO2 Programming - 1 Replies
Just found an easy way to do this with autohotkey. for who ever is interested the ahk script would be: WinWait, Raiding Clans WinMove, 0, 0 ; For top left corner, for right top corner you have to look at what your resolution is to know where to put it. EDIT:// Ok now, with the new chat in conquer i noticed moving my CO with this is not a correct way.



All times are GMT +1. The time now is 06:24.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.