SMF For Free Support Forum
Signup For Free Forum
October 11, 2008, 05:16:56 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to SMF For Free. The best free SMF Host
 
   Home   Help Search Arcade Gallery Login Register  

Pages: [1]
  Print  
Author Topic: Find colour.  (Read 1230 times)
0 Members and 1 Guest are viewing this topic.
|-|Java()|-|
SMF For Free Newbie
*
Offline Offline

Posts: 12


View Profile
« on: July 18, 2007, 10:28:06 pm »

Remember, this returns the coordinates of the color in a window, not the position on the screen, you'll have to use GetWindowRect to get the rect and add the needed numbers to the coordinates for the position on the screen.

Code:
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long

Private Type POINTAPI
    X As Long
    Y As Long
End Type

Function FindColor(Color As Long, X1 As Long, Y1 As Long, X2 As Long, Y2 As Long, _
                            Window As Long) As POINTAPI
Dim xx As Long, yy As Long, TestDC As Long, WndRECT As RECT, temp As POINTAPI
    TestDC = GetDC(Window)
    For yy = Y1 To Y2
        For xx = X1 To X2
            If GetPixel(TestDC, xx, yy) = Color Then
                temp.X = xx
                temp.Y = yy
                FindColor = temp
                Exit Function
            End If
            DoEvents
        Next xx
    Next yy
    FindColor.X = -1
    FindColor.Y = -1
End Function

Enjoy  :cool:
Logged

I am a moparScape expert so if you need anyhelp!
Pm me here or on moparscape and I'll help!!
If you need more help add me on my msn moparsc4p3@hotmail.com

Thanks!
rileyks
SMF For Free Sponsors
*
Offline Offline

Posts: 436


View Profile
« Reply #1 on: July 19, 2007, 08:12:01 am »

Sorry...I don't even understand what this is for.
Logged
Kimmie
SMF For Free Master
*
Offline Offline

Posts: 2013


View Profile WWW
« Reply #2 on: July 19, 2007, 06:41:40 pm »

Sorry...I don't even understand what this is for.

It has to do with the Visual Basic Programming Language and has nothing to do with your forum. Its for people who use VB.  Wink. I dont even know anyone that still uses it...my vb discs are sitting in the back of my vb book collecting dust  Grin.
« Last Edit: July 19, 2007, 06:43:14 pm by Kimmie » Logged

mr_css
SMF For Free Sr. Member
*
Offline Offline

Posts: 259



View Profile
« Reply #3 on: October 20, 2007, 06:17:11 pm »

Quote
Sorry...I don't even understand what this is for.

It has to do with the Visual Basic Programming Language and has nothing to do with your forum. Its for people who use VB.

It is very easy to learn VB (Visual Basics) Is a programming language like Kimmie said. not used for your forums but of course for website developing.It is not used much anymore of course. with all of the programming and new languages.But it is rarely used for things that can be done. VB is very easy like i've said before.I'm only in the 7th grade and i have some knowledge of PHP,Java,Javascript,VB, & HTML.
Logged


            WOLFSCAPE FORUMS
Global
SMF For Free Member
*
Offline Offline

Posts: 20

Is a


View Profile
« Reply #4 on: December 07, 2007, 02:24:49 am »

Quote
Sorry...I don't even understand what this is for.

It has to do with the Visual Basic Programming Language and has nothing to do with your forum. Its for people who use VB.

It is very easy to learn VB (Visual Basics) Is a programming language like Kimmie said. not used for your forums but of course for website developing.It is not used much anymore of course. with all of the programming and new languages.But it is rarely used for things that can be done. VB is very easy like i've said before.I'm only in the 7th grade and i have some knowledge of PHP,Java,Javascript,VB, & HTML.
Visual Basics have nothing to do with Web Development (PHP, CSS, HTML, ect.).

Where did you get that idea?
Logged

Supernovadelta
SMF For Free Full Member
*
Offline Offline

Posts: 106


Supernovadelta Productions.


View Profile WWW
« Reply #5 on: June 17, 2008, 07:25:19 am »

I'l try to find some tutorials for my self,so i can get use to these things.
Logged



Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.6 | SMF © 2006-2008, Simple Machines LLC
ServerBeach Coupon
Page created in 0.228 seconds with 19 queries.