954,582 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Help making this faster

is there anyway i can make this go faster?

Private Function strCoordinates(ImageURL As String, Referer As String) As String
    Dim img() As Byte
    Dim Pet As StdPicture
    Dim ct As Integer
    Dim ctx As Long
    Dim cty As Long
    Dim x As Long
    Dim y As Long
    Dim Value As Single

    GetSource "GET", "captcha_show.phtml?" & ImageURL, "www.neopets.com", "http://www.neopets.com/haggle.phtml?" & Referer, strSession, ""

    img = StrConv(strSource, vbFromUnicode)
    Set Pet = ToJpg(img)
    Set picPet.Picture = Pet

    Value = 4900000
    Do Until ct <> 0
        For y = 0 To picPet.ScaleHeight - 1
        For x = 0 To picPet.ScaleWidth - 1
        If GetPixel(picPet.hdc, x, y) < Value Then
            ct = ct + 1
            ctx = ctx + x
            cty = cty + y
        End If
        Next x
        Next y
        Value = Value + 500000
        DoEvents
    Loop

    strCoordinates = "&x=" & Int(ctx / ct) & "&y=" & Int(cty / ct)
    Set Pet = Nothing
End Function


thanks for any help

cx323
Newbie Poster
4 posts since May 2005
Reputation Points: 10
Solved Threads: 0
 

Shoot me an e-mail and I can help.

noebody
Newbie Poster
1 post since Oct 2005
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You