picea892 Posted April 24, 2009 Share Posted April 24, 2009 Hi Thought I'd see if there was a better way of doing this. I can provide code for the options I've explored if needed but think this is simple enough to just describe it. What I want to do is resize an icon when the mouse hovers over it similar to a Mac interface. I have successfully done this three different ways but am still not satisfied with the quality of the icon or the amount of flicker. Option#1 Description: Create icon at 32x32 onhover delete icon and create 48x48 icon. result: good quality icons but with flicker Option#2 Description: Create icon at 48x48 and resize guictrl to 32x32 before showing. On mousehover, GUICtrlSetPos resized to 48x48 result: 32x32 sized icon has poor quality, flicker is probably best for the options Option#3 Description: Create icon at 32x32 onhover GUICtrlSetData and create 48x48 icon. result: good quality icons but with flicker Is there any other way to do this? I think I'm leaning towards option 3 at this point. Thanks in advance for any advice Link to comment Share on other sites More sharing options...
WideBoyDixon Posted April 24, 2009 Share Posted April 24, 2009 Without seeing the UI it's tricky but perhaps you could create both icons at the beginning and show/hide on mousehover. That is, have two icons and when the mouse hovers over the first one, hide it and show the other one (or simply show the other one over the top). WBD [center]Wide by name, Wide by nature and Wide by girth[u]Scripts[/u]{Hot Folders} {Screen Calipers} {Screen Crosshairs} {Cross-Process Subclassing} {GDI+ Clock} {ASCII Art Signatures}{Another GDI+ Clock} {Desktop Goldfish} {Game of Life} {3D Pie Chart} {Stock Tracker}[u]UDFs[/u]{_FileReplaceText} {_ArrayCompare} {_ToBase}~ My Scripts On Google Code ~[/center] Link to comment Share on other sites More sharing options...
picea892 Posted April 24, 2009 Author Share Posted April 24, 2009 I'll give it a try. Never have much luck with hiding guictrls and showing them again. I guess I could move the icons off the screen and make the swap when needed. Thanks Link to comment Share on other sites More sharing options...
Richard Robertson Posted April 24, 2009 Share Posted April 24, 2009 You'll need to handle drawing yourself to prevent flicker. Windows will redraw the background of a standard control before drawing the foreground. That is unavoidable. Link to comment Share on other sites More sharing options...
picea892 Posted April 24, 2009 Author Share Posted April 24, 2009 How do I draw it myself? Do you mean something like _WinAPI_DrawIconEx Link to comment Share on other sites More sharing options...
Richard Robertson Posted April 24, 2009 Share Posted April 24, 2009 You'll need to do custom drawing of the entire control. I'm not the person to ask about drawing in AutoIt. I never work with AutoIt's GUI code. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now