Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Flicker Free Labels


  • Please log in to reply
73 replies to this topic

#1 Beege

Beege

    Universalist

  • MVPs
  • 895 posts

Posted 21 June 2011 - 09:02 PM

Version 1.6

Lately I have been working on my Wiimote project and the demo GUI for it has a lot labels that get updated frequently and really ends up looking like shit when all your labels are flickering. I put this UDF together trying to go by the same format as native GUICtrlCreateLabel(), this way I can go back to previous guis and swap with new Flicker Free Labels. As always feedback is welcome and let me know if you have and problems. Thanks for looking.

Update 6-27
So recently I learned that the stringformat of the GDI+ labels we are creating do not have equal character spaceing and also are not excepting tab keys. This was a nightmare for me and is still being one. I found a good artical here that helped a little but not completely. At the bottom of the page it talks about displaying adjacent text and recomends using GenericTypographic stringformat. I tried it and It is allowing tab keys, but now the align stopped working. And for the life of me I could never figure out how to set all characters to have equal widths, and also a blank space " " measure out to the same width as a char. So if someone knows how plz let me know. For the time being I have the udf using the method that allows tabs(mainly cause of this example I want to show), but I left the orginal stringformat call commented out so if you need your labels aligned center, left, right just uncomment it and comment out the GenericTypographic call. Its located in _GuiCtrlFFLabel_Create().

Some other Benefits
Now I want to go over a couple benifits that the non flickering labels could extend to you that didnt nessasarly jump right out at u at first. To start with lets go over static labels. Majority of the time that you have some data you want to display you will want a it to have a title. The longer your string is the more obvios the flicker becomes so breaking that label up into two lables Title: Data, can reduce flicker significatly. Now I cant sit hear and say that they are getting broke up soley because of flicker cause thats just not always true, but I can definatly say that they are not being left together because of flicker. Having no flicker we can leave the title and data as one if we want. And we dont have to stop there because string length dosnt matter now. We can just as easily put 3 or 4 labels into one if we want reducing are code even more. take a look at the size difference in the examples.

Easier GUI layout was also a benifit (at least for me) that I didnt think of till recenty. I know plenty of people like to layout there GUI manually. Theres also people that would like to but just arnt good at it. Im one of them. I always end wasting to much time starting, adjusting, starting etc.. I love koda, but it can also gobble up my time. The example shows another option. By making all the labels the full width of the GUI, I can then use tabs and StringFormat() to aliagn all my labels. The only coordinates I have to work with is y, the vertical distance between the labels making it no big deal.

Example:
Spoiler

UDF:
Spoiler


Source:
Attached File  FFLabels.html   165bytes   670 downloads

Update 12/06/11
  • Added option for NO alignment to text. Need if using tabs
Update 6/27/11
  • Added _GUICtrlFFLabel_Move()
  • Changed color parameters. Any function that excepts ARGB will also except RGB
  • Problem found with character width.
Update 6/21/11
  • Added function to establish default background color (Thanks MrCreatoR)
  • Added Delete function and changed function names (Thanks MrCreatoR)
  • changed default color values so -1 and 0 (black and white) can be used as parameters
  • fixed delete problem again. SetData function was not checking if item was deleted. if you try writing to deleted label like example does nothing should happen
Update 6/24/11
  • Added ability to add Labels to multiple GUI's
  • Labels will now automatically refresh themselves when needed
  • Added new functions _GUICtrlFFLabel_GUISetBkColor (Thanks MrCreatoR) , _GUICtrlFFLabel_SetTextColor
  • Labels will not be redraw if window is minimized. This can save quite a bit of CPU usage. Watch CPU% drop if minimized during examples :huh2:

Edited by Beege, 07 December 2011 - 03:42 AM.








#2 UEZ

UEZ

    Never say never

  • MVPs
  • 4,886 posts

Posted 21 June 2011 - 09:19 PM

Nice work and flicker free! :huh2:

Br,
UEZ

 
The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯


#3 Beege

Beege

    Universalist

  • MVPs
  • 895 posts

Posted 21 June 2011 - 09:24 PM

Nice work and flicker free! :huh2:

Br,
UEZ


Thank you!!Posted Image

#4 taietel

taietel

    I'm the third from the left...

  • Active Members
  • PipPipPipPipPipPip
  • 726 posts

Posted 21 June 2011 - 09:27 PM

I use labels a lot on my GUI's and this it's a "must" for me.
Thank you Beege! :huh2:
taietel

#5 MrCreatoR

MrCreatoR

    Must AutoIt!

  • MVPs
  • 3,251 posts

Posted 21 June 2011 - 09:32 PM

Nice, but what about transparent background, like in the original labels?

Btw, you can use $WS_EX_COMPOSITED :huh2:

AutoIt         
#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> _FlickerExample() Func _FlickerExample()     Local $Form1 = GUICreate("Flickering Labels", 400, 220, -1, -1, -1, $WS_EX_COMPOSITED)     Local $Label1 = GUICtrlCreateLabel("", 80, 40, 240, 17)     GUICtrlSetFont(-1, 9, 200, 0, 'Microsoft Sans Serif')     Local $Label2 = GUICtrlCreateLabel("", 80, 80, 240, 17)     GUICtrlSetFont(-1, 9, 200, 0, 'Microsoft Sans Serif')     Local $Label3 = GUICtrlCreateLabel("", 80, 120, 240, 17)     GUICtrlSetFont(-1, 9, 200, 0, 'Microsoft Sans Serif')     GUISetState(@SW_SHOW)     Local $iCount         While 1         Switch GUIGetMsg()             Case $GUI_EVENT_CLOSE                 GUIDelete($Form1)                 Return             Case Else                 $iCount = Random(1, 100000)                 GUICtrlSetData($Label1, "Label One     = " & $iCount)                 $iCount = Random(1, 100000)                 GUICtrlSetData($Label2, "Label Two     = " & $iCount)                 $iCount = Random(1, 100000)                 GUICtrlSetData($Label3, "Label Three  = " & $iCount)         EndSwitch     WEnd EndFunc

  • LeCarre likes this
Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

Posted Image AutoIt Russian CommunityPosted Image Projects: ATT - Application Translate Tool [new] | BlockIt - Block files & folders [new] | SIP - Selected Image Preview [new] | SISCABMAN - SciTE Abbreviations Manager [new] | AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramPosted Image UDFs: OnAutoItErrorRegister - Handle AutoIt critical errors [new] | AutoIt Syntax Highlight [new] | Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDFPosted Image Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation DemoLike the examples/UDFs? Please rate the topic (up-right corner of the post header: Rating Posted Image)* === My topics === *

==========================================================Posted Image==========================================================

AutoIt is simple, subtle, elegant. © AutoIt Team


#6 Beege

Beege

    Universalist

  • MVPs
  • 895 posts

Posted 21 June 2011 - 09:32 PM

I use labels a lot on my GUI's and this it's a "must" for me.
Thank you Beege! :huh2:
taietel


Glad it will help you. Thankyou ;)

#7 Beege

Beege

    Universalist

  • MVPs
  • 895 posts

Posted 21 June 2011 - 09:40 PM

Nice, but what about transparent background, like in the original labels?

Btw, you can use $WS_EX_COMPOSITED :huh2:

AutoIt         
#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> _FlickerExample() Func _FlickerExample()     Local $Form1 = GUICreate("Flickering Labels", 400, 220, -1, -1, -1, $WS_EX_COMPOSITED)     Local $Label1 = GUICtrlCreateLabel("", 80, 40, 240, 17)     GUICtrlSetFont(-1, 9, 200, 0, 'Microsoft Sans Serif')     Local $Label2 = GUICtrlCreateLabel("", 80, 80, 240, 17)     GUICtrlSetFont(-1, 9, 200, 0, 'Microsoft Sans Serif')     Local $Label3 = GUICtrlCreateLabel("", 80, 120, 240, 17)     GUICtrlSetFont(-1, 9, 200, 0, 'Microsoft Sans Serif')     GUISetState(@SW_SHOW)     Local $iCount         While 1         Switch GUIGetMsg()             Case $GUI_EVENT_CLOSE                 GUIDelete($Form1)                 Return             Case Else                 $iCount = Random(1, 100000)                 GUICtrlSetData($Label1, "Label One  = " & $iCount)                 $iCount = Random(1, 100000)                 GUICtrlSetData($Label2, "Label Two  = " & $iCount)                 $iCount = Random(1, 100000)                 GUICtrlSetData($Label3, "Label Three  = " & $iCount)         EndSwitch     WEnd EndFunc


I wanted to do the transparent backgound but didnt know how lol. Thats why the default color is same color autoit backgound is. Do you know how to make it trans?

Also do your labels not flicker when using $WS_EX_COMPOSITED? cause mine still do..

#8 UEZ

UEZ

    Never say never

  • MVPs
  • 4,886 posts

Posted 21 June 2011 - 09:46 PM

AFAIK $WS_EX_COMPOSITED is not working on Vista+ operating systems!

Maybe it will work when Aero is disabled but not tested...

Br,
UEZ

Edited by UEZ, 21 June 2011 - 09:47 PM.

 
The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯


#9 Beege

Beege

    Universalist

  • MVPs
  • 895 posts

Posted 21 June 2011 - 09:52 PM

AFAIK $WS_EX_COMPOSITED is not working on Vista+ operating systems!

Br,
UEZ


Maybe thats my problem. Im using window 7. Im really suprized microsoft didnt fix this problem in Windows 7 or vista. They have know about it for a long time. Heres and artical from 1993 about it

#10 Beege

Beege

    Universalist

  • MVPs
  • 895 posts

Posted 21 June 2011 - 10:20 PM

Nice, but what about transparent background, like in the original labels?


I tried using _WinAPI_GetSysColor($COLOR_WINDOW) but this is not returning background of GUI i just created..

#11 guinness

guinness

    all-consuming swarm in inconspicuous disguise

  • Developers
  • 17,335 posts

Posted 21 June 2011 - 10:35 PM

I just tested $WS_EX_COMPOSITED on Windows 7 x64 and it flickers too.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()LockFile()Mapping CtrlIDsParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...
Updated: 30/07/2014


#12 Beege

Beege

    Universalist

  • MVPs
  • 895 posts

Posted 21 June 2011 - 10:56 PM

I just tested $WS_EX_COMPOSITED on Windows 7 x64 and it flickers too.


Yes from what im reading aero being enabled/disabled wont change that either. Was worried there for a sec I did this for nothing.. wouldnt be the first time Posted Image

#13 MrCreatoR

MrCreatoR

    Must AutoIt!

  • MVPs
  • 3,251 posts

Posted 22 June 2011 - 12:13 AM

Thats why the default color is same color autoit backgound is

On my WinXP it's not :huh2:

Do you know how to make it trans?

With your method no, but you can do this:

Func _GetWindowBkColor()     Local $hBkGUI = GUICreate("", 40, 40, -50, -50)     Local $nColor = PixelGetColor(30, 30, $hBkGUI)     GUIDelete($hBkGUI)     Return "0xFF" & Hex($nColor, 6) EndFunc


now use it in the "#region Header and Global Vars"...
Global $nDef_GUI_Bk_Color = _GetWindowBkColor()

and in...
Func _FF_GuiCtrlSetData($iIndex, $sText, $iBackGround = -1)     If $iBackGround = -1 Or $iBackGround = Default Then $iBackGround = $nDef_GUI_Bk_Color     ... EndFunc

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

Posted Image AutoIt Russian CommunityPosted Image Projects: ATT - Application Translate Tool [new] | BlockIt - Block files & folders [new] | SIP - Selected Image Preview [new] | SISCABMAN - SciTE Abbreviations Manager [new] | AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramPosted Image UDFs: OnAutoItErrorRegister - Handle AutoIt critical errors [new] | AutoIt Syntax Highlight [new] | Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDFPosted Image Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation DemoLike the examples/UDFs? Please rate the topic (up-right corner of the post header: Rating Posted Image)* === My topics === *

==========================================================Posted Image==========================================================

AutoIt is simple, subtle, elegant. © AutoIt Team


#14 Beege

Beege

    Universalist

  • MVPs
  • 895 posts

Posted 22 June 2011 - 12:36 AM

On my WinXP it's not :huh2:


With your method no, but you can do this:

Func _GetWindowBkColor()     Local $hBkGUI = GUICreate("", 40, 40, -50, -50)     Local $nColor = PixelGetColor(30, 30, $hBkGUI)     GUIDelete($hBkGUI)     Return "0xFF" & Hex($nColor, 6) EndFunc


now use it in the "#region Header and Global Vars"...
Global $nDef_GUI_Bk_Color = _GetWindowBkColor()

and in...
Func _FF_GuiCtrlSetData($iIndex, $sText, $iBackGround = -1)     If $iBackGround = -1 Or $iBackGround = Default Then $iBackGround = $nDef_GUI_Bk_Color     ... EndFunc

Now thats a simple and smart solution! Ive been trying and failing so many other ways. Never thought to just create a temporary gui and grab it manually. Thankyou! I will put that in.

#15 MrCreatoR

MrCreatoR

    Must AutoIt!

  • MVPs
  • 3,251 posts

Posted 22 June 2011 - 02:17 AM

Here is a modified version of that UDF, i changed the functions name to _GUICtrlFFLabel_*, and added _GUICtrlFFLabel_Delete function.

Attached File  GUIFFLabel.zip   3.02KB   230 downloads
Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

Posted Image AutoIt Russian CommunityPosted Image Projects: ATT - Application Translate Tool [new] | BlockIt - Block files & folders [new] | SIP - Selected Image Preview [new] | SISCABMAN - SciTE Abbreviations Manager [new] | AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramPosted Image UDFs: OnAutoItErrorRegister - Handle AutoIt critical errors [new] | AutoIt Syntax Highlight [new] | Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDFPosted Image Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation DemoLike the examples/UDFs? Please rate the topic (up-right corner of the post header: Rating Posted Image)* === My topics === *

==========================================================Posted Image==========================================================

AutoIt is simple, subtle, elegant. © AutoIt Team


#16 Beege

Beege

    Universalist

  • MVPs
  • 895 posts

Posted 22 June 2011 - 02:27 AM

Alright added new BG color check function. I had to change it a little bit cause it would not work for me when trying to create the gui off screen or when the states on enabled. Nobody will ever really notice.

Func _GetWindowBkColor()     Local $hBkGUI = GUICreate("", 5, 5, 1, 1, $WS_POPUP, $WS_EX_TOOLWINDOW)     GUISetState()     WinWaitActive($hBkGUI)     Local $nColor = PixelGetColor(3, 3, $hBkGUI)     GUIDelete($hBkGUI)     Return "0xFF" & Hex($nColor, 6) EndFunc

Edited by Beege, 22 June 2011 - 02:46 AM.


#17 Beege

Beege

    Universalist

  • MVPs
  • 895 posts

Posted 22 June 2011 - 02:43 AM

Here is a modified version of that UDF, i changed the functions name to _GUICtrlFFLabel_*, and added _GUICtrlFFLabel_Delete function.

Attached File  GUIFFLabel.zip   3.02KB   230 downloads

I like your naming convention better and will change it to that but the bg function doesnt work. must be something with win 7 vs xp..Posted Image The one I posted above is only 5x5 with no boarders. No one will ever notice.

Posted Image


Edited by Beege, 22 June 2011 - 02:46 AM.


#18 MrCreatoR

MrCreatoR

    Must AutoIt!

  • MVPs
  • 3,251 posts

Posted 22 June 2011 - 02:52 AM

And how about this:

Func __GUICtrlFFLabel_GetWindowBkColor()     Local $iOpt, $hBkGUI, $nColor         $iOpt = Opt("WinWaitDelay", 0)     $hBkGUI = GUICreate("", 40, 40)     WinWait($hBkGUI)     $nColor = "0xFF" & Hex(PixelGetColor(30, 30, $hBkGUI), 6)         ConsoleWrite($nColor & @CRLF)         GUIDelete($hBkGUI)     Opt("WinWaitDelay", $iOpt)         Return $nColor EndFunc


?
:huh2:
Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

Posted Image AutoIt Russian CommunityPosted Image Projects: ATT - Application Translate Tool [new] | BlockIt - Block files & folders [new] | SIP - Selected Image Preview [new] | SISCABMAN - SciTE Abbreviations Manager [new] | AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramPosted Image UDFs: OnAutoItErrorRegister - Handle AutoIt critical errors [new] | AutoIt Syntax Highlight [new] | Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDFPosted Image Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation DemoLike the examples/UDFs? Please rate the topic (up-right corner of the post header: Rating Posted Image)* === My topics === *

==========================================================Posted Image==========================================================

AutoIt is simple, subtle, elegant. © AutoIt Team


#19 Beege

Beege

    Universalist

  • MVPs
  • 895 posts

Posted 22 June 2011 - 03:04 AM

Nope same thing. I dont think pixelgetcolor is getting the pixel 30x30 from the gui client area..

#20 MrCreatoR

MrCreatoR

    Must AutoIt!

  • MVPs
  • 3,251 posts

Posted 22 June 2011 - 03:07 AM

Nope same thing. I dont think pixelgetcolor is getting the pixel 30x30 from the gui client area..

Ok, checked on my laptop with Win7, this should work:

Func __GUICtrlFFLabel_GetWindowBkColor()     Local $iOpt, $hBkGUI, $nColor         $iOpt = Opt("PixelCoordMode", 1)     $hBkGUI = GUICreate("", 100, 100, -100, -100)     $nColor = "0xFF" & Hex(PixelGetColor(50, 50, $hBkGUI), 6)         Opt("PixelCoordMode", $iOpt)     GUIDelete($hBkGUI)         Return $nColor EndFunc

Edited by MrCreatoR, 22 June 2011 - 03:15 AM.

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

Posted Image AutoIt Russian CommunityPosted Image Projects: ATT - Application Translate Tool [new] | BlockIt - Block files & folders [new] | SIP - Selected Image Preview [new] | SISCABMAN - SciTE Abbreviations Manager [new] | AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramPosted Image UDFs: OnAutoItErrorRegister - Handle AutoIt critical errors [new] | AutoIt Syntax Highlight [new] | Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDFPosted Image Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation DemoLike the examples/UDFs? Please rate the topic (up-right corner of the post header: Rating Posted Image)* === My topics === *

==========================================================Posted Image==========================================================

AutoIt is simple, subtle, elegant. © AutoIt Team





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users