Sign in to follow this  
Followers 0

Graphic bug

27 posts in this topic

Posted · Report post

Hi

I have a weird bug, if i wanna set pixels to a graphic, it skips parts.

Posted Image

the blue area is the graphic.

but it just doesnt set pixels in the red part.

this is with all my scripts with a graphic.

Kip :)

Share this post


Link to post
Share on other sites



Posted · Report post

Demonstrating script is missing ...

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

ok, (this is an another script, but it has the same problems)

just move your mouse over the window, and you'll see that it will go 'under something else'

Edited by kip

Share this post


Link to post
Share on other sites

Posted · Report post

Actually, that script appears to work fine. It displays a little arrow where my mouse is and hides my mouse. I examined the code, and that's all I can see that you are doing. It doesn't show anything like your first example.

Share this post


Link to post
Share on other sites

Posted · Report post

Hi,

no problem for me.

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.2.8.1
 Author:		 myName

 Script Function:
	Just move the custom cursor over the window, and youll see my problem

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

#include <GUIConstants.au3>

$GUI = GUICreate("OSdesign",@DesktopWidth/2,@DesktopHeight/2,-1,-1,$WS_POPUP)
GUISetBkColor(0xeeeeee)
GUISetCursor(16,1)
$MOUSE_GRAPHIC = GUICtrlCreateGraphic(0,0,12,12)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_COLOR,0x000000)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,0,0)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,1,0)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,0,1)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,0,2)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,0,3)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,0,4)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,0,5)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,0,6)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,0,7)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,0,8)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,0,9)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,1,9)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,2,8)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,3,7)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,4,7)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,5,7)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,6,7)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,7,7)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,7,6)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,6,5)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,5,4)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,4,3)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,3,2)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,2,1)
GUISetState(@SW_SHOW)

While 1
	$MousePos = GUIGetCursorInfo($GUI)
	GUICtrlSetPos($MOUSE_GRAPHIC,$MousePos[0],$MousePos[1])
	Sleep(10)
WEnd

So long,

Mega

Share this post


Link to post
Share on other sites

Posted · Report post

Works fine with me too?

Share this post


Link to post
Share on other sites

Posted · Report post

Works fine for me too

NOT REPRODUCIBLE

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

ok, it does work on XP, but doesnt work on Vista :)

Edited by kip

Share this post


Link to post
Share on other sites

Posted · Report post

ok, it does work on XP, but doesnt work on Vista :)

So you can understand why it is important to follow sticky directives.

I have no acess to Vista so Jon or other dev have to debug it. :)

Share this post


Link to post
Share on other sites

Posted · Report post

sorry (you mean the os, autoit version, etc. right?)

Share this post


Link to post
Share on other sites

Posted · Report post

sorry (you mean the os, autoit version, etc. right?)

right :)

in your case Vista was so important

Share this post


Link to post
Share on other sites

Posted · Report post

I got a Vista system so now I see that the problem is occuring if the mouse is 250<X>500 for any Y.

X,Y being relative coordinated in the windows;

There is no such check inside AutoIt code so I don't know how to debug such behavior. :)

Share this post


Link to post
Share on other sites

Posted · Report post

I can't reproduce this on Vista running under VMware. Does it require Aero to be enabled? I see nothing out of the ordinary using a non-Aero theme.

Share this post


Link to post
Share on other sites

Posted · Report post

I can't reproduce this on Vista running under VMware. Does it require Aero to be enabled? I see nothing out of the ordinary using a non-Aero theme.

No I am running with Classic. I hope you did understood that the custom cursor is not paint in the read area.

That the script I use

Share this post


Link to post
Share on other sites

Posted · Report post

Cursor is painted fine for me no matter where it's at in the GUI.

Share this post


Link to post
Share on other sites

Posted · Report post

Cursor is painted fine for me no matter where it's at in the GUI.

Can Jos/jon check about this?

I am running Vista X86 FR

Share this post


Link to post
Share on other sites

Posted · Report post

I don't get it in my VMware Vista instance...

Share this post


Link to post
Share on other sites

Posted · Report post

I don't get it in my VMware Vista instance...

at least you and Valik using VMware get same result.

Now I need Jon feedback which is running Vista UK

Share this post


Link to post
Share on other sites

Posted · Report post

Cursor looks OK here.

Share this post


Link to post
Share on other sites

Posted · Report post

Cursor looks OK here.

Are You running Classic theme?

Share this post


Link to post
Share on other sites

Posted · Report post

The cursor looks the same with Classic and Aero.

However, the script you posted just gives me a blue background in both themes. There is no red.

Share this post


Link to post
Share on other sites

Posted · Report post

The cursor looks the same with Classic and Aero.

However, the script you posted just gives me a blue background in both themes. There is no red.

Same here.

Tested in XP, Vista, Both look the same.

Blue BG with the cursor pained fine.

Share this post


Link to post
Share on other sites

Posted · Report post

Try this:

#include <GUIConstants.au3>

$GUI = GUICreate("OSdesign",@DesktopWidth/2,@DesktopHeight/2);,-1,-1,$WS_POPUP)
GUISetBkColor(0xff)
GUISetCursor(16,1)

$g1 = GUICtrlCreateGraphic(0, 0, 200, 200)
GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0xff0000)
For $i = 1 To 100
GUICtrlSetGraphic(-1,$GUI_GR_RECT,0, 0, $i, 200)
Next

$MOUSE_GRAPHIC = GUICtrlCreateGraphic(0,0,12,12)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_COLOR,0x000000)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,0,0)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,1,0)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,0,1)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,0,2)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,0,3)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,0,4)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,0,5)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,0,6)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,0,7)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,0,8)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,0,9)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,1,9)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,2,8)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,3,7)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,4,7)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,5,7)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,6,7)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,7,7)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,7,6)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,6,5)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,5,4)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,4,3)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,3,2)
GUICtrlSetGraphic($MOUSE_GRAPHIC,$GUI_GR_PIXEL,2,1)

$g1 = GUICtrlCreateGraphic(100, 0, 200, 200)
GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0xff0000)
For $i = 1 To 100
GUICtrlSetGraphic(-1,$GUI_GR_RECT,0, 0, $i, 200)
Next

GUISetState(@SW_SHOW)

While 1
	$MousePos = GUIGetCursorInfo($GUI)
	GUICtrlSetPos($MOUSE_GRAPHIC,$MousePos[0],$MousePos[1])
	If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit
WEnd

So the 'mouse-cursor' has to be drawn as last to be on the top.

Share this post


Link to post
Share on other sites

Posted · Report post

I don't know if this is the expected behaviour, but now the "cursor" goes under part of the red area, but appears above the red on other sections of it.

If this is confusing, please say so :D

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

Yeah, that is for demonstrating that this 'cursor'-graphic control has to be drawn as the last graphic.

There are 2 red graphic parts, one before and one after creating the 'cursor' graphic.

Edited by Holger

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.