Champak Posted June 5, 2008 Share Posted June 5, 2008 So I transfered my script and compiled app to a different computer just to make sure the app installs/works correctly and to finish coding there on the latest autoit release. I noticed that the images I set up with transparent surroundings (think of an image of a circle in a square to get what I'm saying, the circle being solid and the outer square being transparent) you can see the area that is suppose to be transparent (the outer square) on the other computer. Now I'm thinking something is wrong for some reason and start meddling with photo and paint shop with no success for 4 hours until I finally get the transparency to match up with the second computer. OK great, everything works now. I take the app back to the original computer, and now it isn't transparent over there anymore with the new color I put as transparent. This time I decide to fiddle with the color settings of the computer, and I get the transparency to work fine. So now the transparency is fine on both computers because they both have the same color settings. This looks like a major issue that I wouldn't have noticed if my other computer didn't have different color settings. I couldn't find any threads on this...I suspect that I probably missed it because this seems like something someone would have complained about already. So is this known already? Is it something that just can't be fixed? Is there a workaround (not trying to do an overlay of another GUI in this situation, because that wont work well with how this app is set up)? To test it out yourself, In Display Properties-->Appearance-->Advanced-->3D Objects. 3D Objects should be the only one you really have to change the color of to see what I'm saying. Although you could just change the color scheme, but that wont always produce an immediate example. So you understand, when I say transparent, I'm not trying to see the desktop through my GUI, just trying to make the surrounding area of my image transparent on top of my GUI. So what's the deal? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 5, 2008 Moderators Share Posted June 5, 2008 And the bpp are the same on both pc's? 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. Link to comment Share on other sites More sharing options...
Champak Posted June 5, 2008 Author Share Posted June 5, 2008 1/ What is bpp? 2/ Even if they are different, wouldn't that still constitute a problem in that other computers may/would have a different bpp? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 5, 2008 Moderators Share Posted June 5, 2008 1/ What is bpp?2/ Even if they are different, wouldn't that still constitute a problem in that other computers may/would have a different bpp?bpp is bits per pixel.Well a lot of things could make the difference on the pic and the outline you are using. If the themes are the same, if the pixel bits are the same (ie 16 bit / 32 bit).You may want to look at the png option by lodn3 http://www.autoitscript.com/forum/index.ph...7651&hl=png in the example forum. That very well could solve all your issues. 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. Link to comment Share on other sites More sharing options...
Champak Posted June 5, 2008 Author Share Posted June 5, 2008 Yeah the bpp are both set to 32. Once both computers have the same color settings/theme, everything works fine. But that to me IS the problem. "Transparent" should be transparent no matter what the "basic" color settings are (of course not considering safe mode). Shouldn't it? I haven't come across this problem with any other app I've used...then again I wouldn't know if the app contained any transparent images or not; but if it is transparent within the photo editing software and preview, it SHOULD be transparent within autoit as it is everywhere else regardless of settings. I came across that thread by lodn3, didn't really dive into it too much because it just seemed a little more than what I wanted to get into. I guess I'll look at it again. But the fact still remains, this isn't good. I came across another post where someone recommended that GUICtrlSetBkColor() should apply to pics where you input the color you want transparent and it is taken care of. That to me seems like a great idea where if this problem can't be fixed within the core for whatever reason, should be able to resolve this problem. Link to comment Share on other sites More sharing options...
Champak Posted June 6, 2008 Author Share Posted June 6, 2008 (edited) That PNG option wont work for me because it requires layered GUIs, and in my current set up, it is not feasible.OK, here is what I did and it seems to work great. I used a com named nconvert. $SystemColor = RegRead("HKEY_CURRENT_USER\Control Panel\Colors", "ActiveBorder") $SC = StringSplit($SystemColor, ' ') $oImageConvert.LoadBitmap ($Image6); $oImageConvert.ChangeColorDepth(0);Get True color of image $oImageConvert.ReplaceColor(0xFF00FF, Dec( Hex($SC[3],2) & Hex($SC[2],2) & Hex($SC[1],2)), 1);(Color I want to change, Color of system, Tolerance) $oImageConvert.SaveBitmap ($Image6)But this still should be fixed at the core.EDIT:This doesn't work as I expected it to. When I change the theme by itself, this function wont work (What I was doing for a quick test with all colors was the Control Panel-->Display Properties-->Appearance-->Advanced-->3D Objects) . When I change the theme, none of the colors settings in the control panel colors reg folder have anything to do with the theme setting. And thus my solution wont work in that case. So does anyone know where ALL the colors associated with the theme settings are? Edited June 6, 2008 by Champak Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 6, 2008 Share Posted June 6, 2008 There's a function called GetSystemColor() that will allow you to read the colors. Link to comment Share on other sites More sharing options...
Champak Posted June 6, 2008 Author Share Posted June 6, 2008 (edited) Yeah, I came across that first, the problem is it doesn't give the RGB value in a separated format. Meaning Red is given as just "255" instead of "255 0 0". The string length will always be different depending on the color. In that case, how would I convert it to be able to use in the code in post 6? Edited June 6, 2008 by Champak Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 6, 2008 Moderators Share Posted June 6, 2008 Yeah, I came across that first, the problem is it doesn't give the RGB value in a separated format. Meaning Red is given as just "255" instead of "255 0 0". The string length will always be different depending on the color. In that case, how would I convert it to be able to use in the code in post 6?It does return RGB... to break it up to Red/Green/Blue individually, you'd have to use the Color udf's in the Color.au3. 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. Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 6, 2008 Share Posted June 6, 2008 It doesn't return a string. It returns an integer. It's not hard to break it into separate bits. Color UDF works too. I didn't even think of that. Link to comment Share on other sites More sharing options...
Champak Posted June 6, 2008 Author Share Posted June 6, 2008 (edited) Ah, I was looking at that but didn't really understand how it worked(didn't think it could give me what I wanted). Everything is all good now....for now. Transparency seems to work between all computers/color settings/themes. I guess I'll try for the next hour to break it, hopefully it wont. Thanks. New code: $R = _ColorGetRed(_WinAPI_GetSysColor($COLOR_3DFACE)) $G = _ColorGetGreen(_WinAPI_GetSysColor($COLOR_3DFACE)) $B = _ColorGetBlue(_WinAPI_GetSysColor($COLOR_3DFACE)) $oImageConvert.LoadBitmap ($Image6); $oImageConvert.ChangeColorDepth(0);Get True color of image $oImageConvert.ReplaceColor(0xFF00FF, Dec( Hex($R,2) & Hex($G,2) & Hex($B,2)), 1);(Color I want to change, Color of system, Tolerance) $oImageConvert.SaveBitmap ($Image6) Note: although the code says "LoadBitmap" you can use gif, jpg, and probably png as well. Edited June 6, 2008 by Champak Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 6, 2008 Moderators Share Posted June 6, 2008 Ah, I was looking at that but didn't really understand how it worked(didn't think it could give me what I wanted). Everything is all good now....for now. Transparency seems to work between all computers/color settings/themes. I guess I'll try for the next hour to break it, hopefully it wont. Thanks. New code: $R = _ColorGetRed(_WinAPI_GetSysColor($COLOR_3DFACE)) $G = _ColorGetGreen(_WinAPI_GetSysColor($COLOR_3DFACE)) $B = _ColorGetBlue(_WinAPI_GetSysColor($COLOR_3DFACE)) $oImageConvert.LoadBitmap ($Image6); $oImageConvert.ChangeColorDepth(0);Get True color of image $oImageConvert.ReplaceColor(0xFF00FF, Dec( Hex($R,2) & Hex($G,2) & Hex($B,2)), 1);(Color I want to change, Color of system, Tolerance) $oImageConvert.SaveBitmap ($Image6)oÝ÷ ØÚ-y©m Ø^r^±¬¬ªê-.+fj®¢Ü¨¹Æ§ºÇ øé©Ý¦ºi¹r¦x³¥ú®¢×,(ºWr¢éíìz«j×jYl¶axÈjëh×6$R = _ColorGetRed(_WinAPI_GetSysColor($COLOR_3DFACE)) $G = _ColorGetGreen(_WinAPI_GetSysColor($COLOR_3DFACE)) $B = _ColorGetBlue(_WinAPI_GetSysColor($COLOR_3DFACE))oÝ÷ Ù«¢+Ù¥´ÀÌØíIô}]¥¹A%}ÑMåÍ ½±½È ÀÌØí =1=I|Í ¤)¥´ÀÌØíIô} ½±½ÉÑI ÀÌØíI¤)¥´ÀÌØíɸô} ½±½ÉÑɸ ÀÌØíI¤)¥´ÀÌØí ±Õô} ½±½ÉÑ ±Õ ÀÌØíI¤ 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. Link to comment Share on other sites More sharing options...
Champak Posted June 6, 2008 Author Share Posted June 6, 2008 Your absolutely right. Thanks. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 6, 2008 Moderators Share Posted June 6, 2008 Your absolutely right. Thanks.I'm curious now looking at this code: $oImageConvert.LoadBitmap ($Image6); $oImageConvert.ChangeColorDepth(0);Get True color of image $oImageConvert.ReplaceColor(0xFF00FF, _WinAPI_GetSysColor($COLOR_3DFACE), 1);(Color I want to change, Color of system, Tolerance) $oImageConvert.SaveBitmap ($Image6) Doesn't work? 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. Link to comment Share on other sites More sharing options...
Champak Posted June 6, 2008 Author Share Posted June 6, 2008 Unbelievable, all that time trying to convert the damn colors and I had the code in front of me 3 hours ago. So 2 for 2 for you, thanks. Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 7, 2008 Share Posted June 7, 2008 You do realize that hex values are treated as numbers, right? 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