Sign in to follow this  
Followers 0
Busti

error or bug or something else ?

12 posts in this topic

hi, i got a quick question, are there limitations for :

GUICtrlSetBkColor()

?

becouse i cant fill all of my field's :D

about 2000+


My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity

Share this post


Link to post
Share on other sites



sry forgot code :

#include <GuiConstants.au3>
HotKeySet( "{ESC}", "_exit" )
Dim $scanwidht=100,$scanheight=100
Dim $Label[$scanheight+$scanheight][$scanwidht+$scanwidht][10]
Dim $color[$scanheight+$scanheight][$scanwidht+$scanwidht][10]

WinMinimizeAll()
Sleep(3000)
$gui = _SetGui()
$lab = _CreateLabels()
;$col = _SetColor($colors)
While 1
    Sleep(1)
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then
        ExitLoop
     EndIf
WEnd
    
Func _SetGui()
$drawgui = GUICreate( "-MyDesktop-" , $scanwidht*2, $scanheight*2 , -1 , -1 ) 
GUISetState(@SW_SHOW)
EndFunc

Func _CreateLabels()
#cs ; if the under doesnt work...
Dim $w[7] = ["",0,20,40,60,80,100]
Dim $h[7] = ["",0,20,40,60,80,100]
#ce
;test :
Dim $w[7] = ["",0,$scanwidht/5  ,$scanwidht/2.5 ,$scanwidht/1.6666666666666666666666666666667   ,$scanwidht/1.25    ,$scanwidht ]
Dim $h[7] = ["",0,$scanheight/5 ,$scanheight/2.5,$scanheight/1.6666666666666666666666666666667  ,$scanheight/1.25   ,$scanheight]
Dim $H_Inc = 1 , $W_Inc = 1
#cs
For $h[1] = 1 To $scanheight/4
    For $w[1] = 1 To $scanwidht/4
        ToolTip("current labels :" & @CRLF & _
                "height :" & $h[1] & @CRLF & _
                "width :" & $w[1] ,0,0)
        $color[$h[1]][$w[1]][1] = PixelGetColor( $h[1] , $w[1] )
        $Label[$h[1]][$w[1]] = GUICtrlCreateLabel( "" , $h[1] , $w[1] , 1 , 1 )
        GUICtrlSetBkColor( -1 , $color[$h[1]][$w[1]] )

        $h[2] += 1
        $w[2] += 1
        $color[$h[2]][$w[2]][1] = PixelGetColor( $h[2] , $w[2] )
        $Label[$h[2]][$w[2]] = GUICtrlCreateLabel( "" , $h[2] , $w[2] , 1 , 1 )
        GUICtrlSetBkColor( -1 , $color[$h[2]][$w[2]] )

        $h[3] += 1
        $w[3] += 1
        $color[$h[3]][$w[3]][1] = PixelGetColor( $h[3] , $w[3] )
        $Label[$h[3]][$w[3]] = GUICtrlCreateLabel( "" , $h[3] , $w[3] , 1 , 1 )
        GUICtrlSetBkColor( -1 , $color[$h[3]][$w[3]] )

        $h[4] += 1
        $w[4] += 1
        $color[$h[4]][$w[4]][1] = PixelGetColor( $h[4] , $w[4] )
        $Label[$h[4]][$w[4]] = GUICtrlCreateLabel( "" , $h[4] , $w[4] , 1 , 1 )
        GUICtrlSetBkColor( -1 , $color[$h[4]][$w[4]] )


    Next
Next
#ce
$scanheight = $scanheight/5
$scanwidht  = $scanwidht/5
While $h[1] <= $scanheight
    $h[1] += $H_Inc
    $h[2] += $H_Inc
    $h[3] += $H_Inc
    $h[4] += $H_Inc
    $h[5] += $H_Inc
    While $w[1] <= $scanwidht*5
        ToolTip("current labels :" & @CRLF & _
                "height[1] :" & $h[1] & @CRLF & _
                "width[1] :" & $w[1] & @CRLF & _
                "height[2] :" & $h[2] & @CRLF & _
                "width[2] :" & $w[2] & @CRLF & _
                "height[3] :" & $h[3] & @CRLF & _
                "width[3] :" & $w[3] & @CRLF & _
                "height[4] :" & $h[4] & @CRLF & _
                "width[4] :" & $w[4] & @CRLF & _
                "height[5] :" & $h[5] & @CRLF & _
                "width[5] :" & $w[5] & @CRLF ,0,0)
                
        $w[1] += $W_Inc
        $color[$h[1]][$w[1]][1] = PixelGetColor( $h[1] , $w[1] )
        $Label[$h[1]][$w[1]][1] = GUICtrlCreateLabel( "" , $h[1] , $w[1] , 1 , 1 )
        GUICtrlSetBkColor( $Label[$h[1]][$w[1]][1] , $color[$h[1]][$w[1]][1] )

        $w[2] += $W_Inc
        $color[$h[2]][$w[2]][2] = PixelGetColor( $h[2] , $w[2] )
        $Label[$h[2]][$w[2]][2] = GUICtrlCreateLabel( "" , $h[2] , $w[2] , 1 , 1 )
        GUICtrlSetBkColor( $Label[$h[2]][$w[2]][2] , $color[$h[2]][$w[2]][2] )

        $w[3] += $W_Inc
        $color[$h[3]][$w[3]][3] = PixelGetColor( $h[3] , $w[3] )
        $Label[$h[3]][$w[3]][3] = GUICtrlCreateLabel( "" , $h[3] , $w[3] , 1 , 1 )
        GUICtrlSetBkColor( $Label[$h[3]][$w[3]][3] , $color[$h[3]][$w[3]][3] )

        $w[4] += $W_Inc
        $color[$h[4]][$w[4]][4] = PixelGetColor( $h[4] , $w[4] )
        $Label[$h[4]][$w[4]][4] = GUICtrlCreateLabel( "" , $h[4] , $w[4] , 1 , 1 )
        GUICtrlSetBkColor( $Label[$h[4]][$w[4]][4] , $color[$h[4]][$w[4]][4] )

        $w[5] += $W_Inc
        $color[$h[5]][$w[5]][5] = PixelGetColor( $h[5] , $w[5] )
        $Label[$h[5]][$w[5]][5] = GUICtrlCreateLabel( "" , $h[5] , $w[5] , 1 , 1 )
        GUICtrlSetBkColor( $Label[$h[5]][$w[5]][5] , $color[$h[5]][$w[5]][5] )

    WEnd
    $w[1] = 0
    $w[2] = 0
    $w[3] = 0
    $w[4] = 0
    $w[5] = 0
WEnd
#cs
Do
    $h[1] += 1
    $h[2] += 1
    $h[3] += 1
    $h[4] += 1
    Do
        ToolTip("current labels :" & @CRLF & _
                "height[1] :" & $h[1] & @CRLF & _
                "width[1] :" & $w[1] & @CRLF & _
                "height[2] :" & $h[2] & @CRLF & _
                "width[2] :" & $w[2] & @CRLF & _
                "height[3] :" & $h[3] & @CRLF & _
                "width[3] :" & $w[3] & @CRLF & _
                "height[4] :" & $h[4] & @CRLF & _
                "width[4] :" & $w[4] & @CRLF ,0,0)
                
        $w[1] += 1
        $color[$h[1]][$w[1]][1] = PixelGetColor( $h[1] , $w[1] )
        $Label[$h[1]][$w[1]][1] = GUICtrlCreateLabel( "" , $h[1] , $w[1] , 1 , 1 )
        GUICtrlSetBkColor( $Label[$h[1]][$w[1]][1] , $color[$h[1]][$w[1]][1] )

        $w[2] += 1
        $color[$h[2]][$w[2]][2] = PixelGetColor( $h[2] , $w[2] )
        $Label[$h[2]][$w[2]][2] = GUICtrlCreateLabel( "" , $h[2] , $w[2] , 1 , 1 )
        GUICtrlSetBkColor( $Label[$h[2]][$w[2]][2] , $color[$h[2]][$w[2]][2] )

        $w[3] += 1
        $color[$h[3]][$w[3]][3] = PixelGetColor( $h[3] , $w[3] )
        $Label[$h[3]][$w[3]][3] = GUICtrlCreateLabel( "" , $h[3] , $w[3] , 1 , 1 )
        GUICtrlSetBkColor( $Label[$h[3]][$w[3]][3] , $color[$h[3]][$w[3]][3] )

        $w[4] += 1
        $color[$h[4]][$w[4]][4] = PixelGetColor( $h[4] , $w[4] )
        $Label[$h[4]][$w[4]][4] = GUICtrlCreateLabel( "" , $h[4] , $w[4] , 1 , 1 )
        GUICtrlSetBkColor( $Label[$h[4]][$w[4]][4] , $color[$h[4]][$w[4]][4] )
        GUICtrlCreateGraphic( $h[4] , $w[4] , 1 , 1 , $color[$h[4]][$w[4]][4] )
    Until $w[1] >= $scanwidht/4
    $w[1] = 0
    $w[2] = 0
    $w[3] = 0
    $w[4] = 0

Until $h[1] >= $scanheight/4
#ce

EndFunc

Func _exit()
    Exit
EndFunc

My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I don't know about 2000 but there are limits:

Maximum number of GUI windows: 1024

Maximum number of GUI controls per window: 4096

Edit:

Also take a look at this, may help you in the future to slim your future scripts:

For $iCount = 1 To 5
            $w[$iCount] += $W_Inc
            $color[$h[$iCount]][$w[$iCount]][$iCount] = PixelGetColor( $h[$iCount] , $w[$iCount] )
            $Label[$h[$iCount]][$w[$iCount]][$iCount] = GUICtrlCreateLabel( "" , $h[$iCount] , $w[$iCount] , 1 , 1 )
            GUICtrlSetBkColor( $Label[$h[$iCount]][$w[$iCount]][$iCount] , $color[$h[$iCount]][$w[$iCount]][$iCount] )
        Next
    WEnd
    For $iCount = 1 To 5
        $w[$iCount] = 0
    NextoÝ÷ ÙW«²ëºÚ"µÍ    ÌÍÝÖÌWH
ÏH ÌÍÕ×Ò[Â   ÌÍØÛÛÜÉÌÍÚÌWWVÉÌÍÝÖÌWWVÌWHH^[Ù]ÛÛÜ    ÌÍÚÌWH  ÌÍÝÖÌWH
B   ÌÍÓX[ÉÌÍÚÌWWVÉÌÍÝÖÌWWVÌWHHÕRPÝÜX]SX[
    ][ÝÉ][ÝÈ    ÌÍÚÌWH  ÌÍÝÖÌWHHH
BÕRPÝÙ]ÐÛÛÜ  ÌÍÓX[ÉÌÍÚÌWWVÉÌÍÝÖÌWWVÌWH    ÌÍØÛÛÜÉÌÍÚÌWWVÉÌÍÝÖÌWWVÌWH
B   ÌÍÝÖÌH
ÏH ÌÍÕ×Ò[Â   ÌÍØÛÛÜÉÌÍÚÌWVÉÌÍÝÖÌWVÌHH^[Ù]ÛÛÜ   ÌÍÚÌH   ÌÍÝÖÌH
B   ÌÍÓX[ÉÌÍÚÌWVÉÌÍÝÖÌWVÌHHÕRPÝÜX]SX[
    ][ÝÉ][ÝÈ    ÌÍÚÌH   ÌÍÝÖÌHHH
BÕRPÝÙ]ÐÛÛÜ  ÌÍÓX[ÉÌÍÚÌWVÉÌÍÝÖÌWVÌH   ÌÍØÛÛÜÉÌÍÚÌWVÉÌÍÝÖÌWVÌH
B   ÌÍÝÖÌ×H
ÏH ÌÍÕ×Ò[   ÌÍØÛÛÜÉÌÍÚÌ×WVÉÌÍÝÖÌ×WVÌ×HH^[Ù]ÛÛÜ ÌÍÚÌ×H ÌÍÝÖÌ×H
B   ÌÍÓX[ÉÌÍÚÌ×WVÉÌÍÝÖÌ×WVÌ×HHÕRPÝÜX]SX[
    ][ÝÉ][ÝÈ    ÌÍÚÌ×H ÌÍÝÖÌ×HHH
BÕRPÝÙ]ÐÛÛÜ  ÌÍÓX[ÉÌÍÚÌ×WVÉÌÍÝÖÌ×WVÌ×H ÌÍØÛÛÜÉÌÍÚÌ×WVÉÌÍÝÖÌ×WVÌ×H
B   ÌÍÝÖÍH
ÏH ÌÍÕ×Ò[Â   ÌÍØÛÛÜÉÌÍÚÍWVÉÌÍÝÖÍWVÍHH^[Ù]ÛÛÜ   ÌÍÚÍH   ÌÍÝÖÍH
B   ÌÍÓX[ÉÌÍÚÍWVÉÌÍÝÖÍWVÍHHÕRPÝÜX]SX[
    ][ÝÉ][ÝÈ    ÌÍÚÍH   ÌÍÝÖÍHHH
BÕRPÝÙ]ÐÛÛÜ  ÌÍÓX[ÉÌÍÚÍWVÉÌÍÝÖÍWVÍH   ÌÍØÛÛÜÉÌÍÚÍWVÉÌÍÝÖÍWVÍH
B   ÌÍÝÖÍWH
ÏH ÌÍÕ×Ò[Â   ÌÍØÛÛÜÉÌÍÚÍWWVÉÌÍÝÖÍWWVÍWHH^[Ù]ÛÛÜ    ÌÍÚÍWH  ÌÍÝÖÍWH
B   ÌÍÓX[ÉÌÍÚÍWWVÉÌÍÝÖÍWWVÍWHHÕRPÝÜX]SX[
    ][ÝÉ][ÝÈ    ÌÍÚÍWH  ÌÍÝÖÍWHHH
BÕRPÝÙ]ÐÛÛÜ  ÌÍÓX[ÉÌÍÚÍWWVÉÌÍÝÖÍWWVÍWH    ÌÍØÛÛÜÉÌÍÚÍWWVÉÌÍÝÖÍWWVÍWH
BÑ[    ÌÍÝÖÌWHH   ÌÍÝÖÌHH    ÌÍÝÖÌ×HH  ÌÍÝÖÍHH    ÌÍÝÖÍWHH

Edit2:

Damn code tags!! :D

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

now your is running through 4 loops, i think its slower or ?

and my through 2 :/ but dunno, but not good :D

why only 4xxx ?

how to draw the desktop then :D

but thx 4 looking

Edited by Busti

My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

now your is running through 4 loops, i think its slower or ?

and my through 2 :/ but dunno, but not good :D

why only 4xxx ?

how to draw the desktop then :D

but thx 4 looking

4 loops? It's not 5 minus 1... test this in an example
For $i = 1 To 5
    MsgBox(0, 'Info Example', 'Count & ' & $i & ' is ' & $i)
Next
[Edit]I should add here that, my code does "exactly" what yours does :P [/Edit]

Why only 4xxx ... I'm not a Dev, I couldn't tell you. Why only 64 hotkeys, why are we only allowed 64kbs for an Ini file... these are all questions that the Devs would have to answer.

Drawing the desktop may not be an option, but maybe taking a snap shot of the desktop of x and y coords, and saving that to a file, then using GUICtrlCreatePic() might be an answer?

Good Luck, time to snooze.

Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

yes and how to save it without extern dll ?


My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity

Share this post


Link to post
Share on other sites

hi, i got a quick question, are there limitations for :

GUICtrlSetBkColor()

?

becouse i cant fill all of my field's :D

about 2000+

There is an internal brush color cache mechanism which is limited to 32.

Any other color is not cache.

Share this post


Link to post
Share on other sites

There is an internal brush color cache mechanism which is limited to 32.

Any other color is not cache.

how do you mean that ?

each color can be used 32 times?


My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity

Share this post


Link to post
Share on other sites

how do you mean that ?

each color can be used 32 times?

you can have only 32 color which are directly displayed without having an internal mechanism which recreate another color.

I have trouble with the above example to see if something is wrong or not can you simpilfied it?

Thanks :D

Share this post


Link to post
Share on other sites

there os a tooltip, its easy too see becouse :

the tooltip is countig, but the gui is not drawing !

i think i cant create more labels !


My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity

Share this post


Link to post
Share on other sites

there os a tooltip, its easy too see becouse :

the tooltip is countig, but the gui is not drawing !

i think i cant create more labels !

I run it but still too complicated to debug :D

Share this post


Link to post
Share on other sites

hehe^^

i found another way to do it ! (will release it !)

a question :

does PixelGetColor(x,y)

really get the real pixels ?

becouse my programm draws blue and not red pixels :D ?


My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity

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  
Followers 0