kev51773 Posted September 11, 2013 Share Posted September 11, 2013 I have created a Pic control using GUICtrlCreatePic, I use this control to display a gif image. All works well. If I try to update the image using GUICtrlSetImage, the same image will not display and the GUICtrlSetImage returns 0. This only seems to occur with 3bit gif images and more specifically only in 3 bit gif images if they contain a value greater than 0 for all three of red, green and blue. I'm probably not explaining this will so instead please see the following examples, the images are identical apart from the colour. All will display with GUICtrlCreatePic, but only the first three will work with GUICtrlSetImage. The only way I can make this image display is by saving it as 8 bit, thereby increasing file size by over 13 times. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 11, 2013 Moderators Share Posted September 11, 2013 Hi, kev51773. Please post your code, so we can see what you're doing. Otherwise, we first have to guess at what you're doing, and then try to troubleshoot it for you "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
kev51773 Posted September 11, 2013 Author Share Posted September 11, 2013 (edited) Actually, oops. It doesn't return 0 (I was getting the return value from my function). It just doesn't display anything. Now I'm suspecting it's a transparency problem but I can't for the life of me figure of a good way to sort it. I wanted 3 bit gifs for the smallest possible file size. There doesn't seem much point in posting my code now I realise that I was wrong with the return value, the remainder of the problem can be recreated by GUICreate("test") $pic = GUICtrlCreatePic("C:\blah\Blue.gif",0,0) GUISetState() sleep(1000) GUICtrlSetImage($pic,"C:\blah\White.gif") sleep(1000) exit The blue image will not be replaced by the white. If you swap the two file names then it will successfully change from white to blue. Edited September 11, 2013 by kev51773 Link to comment Share on other sites More sharing options...
dragan Posted September 11, 2013 Share Posted September 11, 2013 You cannot use gifs to set image to the button. You can save them as jpg though and then use them. The other idea could be to load gif into gdi, convert to bmp, save as temporary file, use it for a button, and delete the temp bmp afterwards. Link to comment Share on other sites More sharing options...
kev51773 Posted September 11, 2013 Author Share Posted September 11, 2013 (edited) The gifs work fine in every other colour than white (It's even specified that it supported in the help file for GUICtrlCreatePic). In fact, even the white works with GuiCtrlCreatePic, it's just the one colour variation of identical images that won't work with GuiCtrlSetImage. I'd really rather not get into GDI. I started that way and found it very slow (probably my own fault) I guess I have two choices a) delete and recreate the picture control rather than updating the image in an existing picture control use 8 bit gifs because they seem to work without issue and although they're larger they're still considerably smaller than bmp or jpg) Edited September 11, 2013 by kev51773 Link to comment Share on other sites More sharing options...
jaberwacky Posted September 11, 2013 Share Posted September 11, 2013 If it is such that GUICtrlSetImage cannot handle certain gifs then you should file a bug report. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
DW1 Posted September 11, 2013 Share Posted September 11, 2013 The gifs work fine in every other colour than white (It's even specified that it supported in the help file for GUICtrlCreatePic). In fact, even the white works with GuiCtrlCreatePic, it's just the one colour variation of identical images that won't work with GuiCtrlSetImage. I'd really rather not get into GDI. I started that way and found it very slow (probably my own fault) I guess I have two choices a) delete and recreate the picture control rather than updating the image in an existing picture control use 8 bit gifs because they seem to work without issue and although they're larger they're still considerably smaller than bmp or jpg) or c) use GDI+ as it seems to handle the files fine. I agree that you should submit a bug report, and even if it turns out to be working as designed, it would be nice if you could come back to this thread and let us know the outcome. AutoIt3 Online Help Link to comment Share on other sites More sharing options...
kev51773 Posted September 12, 2013 Author Share Posted September 12, 2013 Ticket #2461 created. http://www.autoitscript.com/trac/autoit/ticket/2461 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