Advertise Here

Author Topic: Find colour.  (Read 14692 times)

0 Members and 1 Guest are viewing this topic.

Offline |-|Java()|-|

  • SMF For Free Newbie
  • *
  • Posts: 12
    • View Profile

  • Total Badges: 11
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 10 Posts
Find colour.
« 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: [Select]
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:
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!

Offline rileyks

  • SMF For Free Sponsors
  • *
  • Posts: 530
    • View Profile

  • Total Badges: 16
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: Find colour.
« Reply #1 on: July 19, 2007, 08:12:01 am »
Sorry...I don't even understand what this is for.

Offline Kimmie

  • SMF For Free Master
  • *
  • Posts: 2010
    • View Profile
    • Kimmie's Caverns

  • Total Badges: 19
    Badges: (View All)
    Topic Starter Combination Level 4 Level 3 Level 2
Re: Find colour.
« 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.  ;). I dont even know anyone that still uses it...my vb discs are sitting in the back of my vb book collecting dust  ;D.
« Last Edit: July 19, 2007, 06:43:14 pm by Kimmie »

Offline mr_css

  • SMF For Free Sr. Member
  • *
  • Posts: 252
    • View Profile

  • Total Badges: 15
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: Find colour.
« 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.

            WOLFSCAPE FORUMS

Offline Global

  • SMF For Free Member
  • *
  • Posts: 20
  • Is a
    • View Profile

  • Total Badges: 11
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 10 Posts
Re: Find colour.
« 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?

Offline Supernovadelta

  • SMF For Free Member
  • *
  • Posts: 92
  • Supernovadelta Productions.
    • View Profile
    • supernovadelta

  • Total Badges: 15
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: Find colour.
« 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.

 

Related Topics

  Subject / Started by Replies Last post
6 Replies
1617 Views
Last post March 25, 2007, 10:35:37 pm
by Liandran
7 Replies
1742 Views
Last post January 29, 2008, 10:35:06 pm
by Nutz
2 Replies
1365 Views
Last post March 23, 2008, 11:46:24 am
by tawr
3 Replies
1049 Views
Last post June 21, 2008, 05:57:07 pm
by MR.SATAN
11 Replies
2465 Views
Last post January 13, 2009, 01:34:04 pm
by simply sibyl