eHrgo Posted July 7, 2007 Share Posted July 7, 2007 (edited) Hi there,There is not much code I can share you for this... thats quite usual situation:At the begining I wouldn't create a post for that but I don't even suceed to recreate a background with transparency:#include <GUIConstants.au3> GUICreate("", 50, 50, -1, -1, $WS_POPUP,$WS_EX_LAYERED) GUICtrlCreatePic(@ScriptDir&'/background.gif', 0,0,0,0) While 1 GUISetState(@SW_SHOW) Sleep(10) WendWhy isn't that working? I have a white background why this script!I've heard about top left pixel on this forum, why? Transparency should be defined in software like photoshop, not by one pixel on top left corner? I'm lost. Thanks for your time and your help. Edited July 7, 2007 by eHrgo Sorry for my Bad English. Link to comment Share on other sites More sharing options...
eHrgo Posted July 7, 2007 Author Share Posted July 7, 2007 Up! I've really tried anything, it worked with another script, with an other picture .. but now.. weird. Sorry for my Bad English. Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 7, 2007 Share Posted July 7, 2007 (edited) I've really tried anything, it worked with another script, with an other picture .. but now.. weird. I don't see the issue. The transparency works fine for me. Might have helped if you had posted working code: #include <GUIConstants.au3> Opt("GuiOnEventMode", 1) Global $avColors[3] = [0x0000FF, 0x00FF00, 0xFF0000] $Time = @SEC $hGUI = GUICreate("Transparency Test", 250, 100, -1, -1, -1,$WS_EX_LAYERED) GUISetOnEvent($GUI_EVENT_CLOSE, "_Quit") GUICtrlCreatePic("C:\Temp\4kp3o7d.gif", 100, 25, 50, 50) GUISetState() While 1 If @SEC <> $Time Then $Time = @SEC GUISetBkColor($avColors[Mod($Time, 3)]) EndIf Sleep(20) WEnd Func _Quit() Exit EndFunc Edit: I was going to whine about the 0 width and 0 height, but I had missed this little gem in the help file for GuiCtrlCreatePic(): If you want to have a picture having the same size as the file content just use width=height=0. Doh! Edited July 7, 2007 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Valuater Posted July 7, 2007 Share Posted July 7, 2007 Works for me too!~ Just remember if you are going place controls on-top of a trans-pic, use the disable state GUICtrlSetState( -1, $GUI_DISABLE) 8) Link to comment Share on other sites More sharing options...
eHrgo Posted July 7, 2007 Author Share Posted July 7, 2007 Huuuuum, ok.I found out something:To be able to see through the Window (instead of juste seeing through the picture) you need the exact same code but you need to put a pixel of whatever color (different from white)... Every other pixel of the picture will be transparent!Thats why this script:#include <GUIConstants.au3> GUICreate("", 50, 50, -1, -1, $WS_POPUP,$WS_EX_LAYERED) GUICtrlCreatePic(@ScriptDir&'/background.gif', 0,0,0,0) While 1 GUISetState(@SW_SHOW) Sleep(10) WendoÝ÷ Ø&§«ÞÙçßyËl!ûazÚ)çí¦,^+0+^b«¦'-º·°YezÖ©¥æ«¶iÉ ®§v)ð+^ÎÞ±çêkzø¨ºÃìj[r +®*m!ûazÚ)çí¦,^+0«^½êÞÇ¢êéËnì"Y^µªiyªò¢êÝzÉ-¢§¶¬rh¯}âm¶ÿËb*bqÊ&ÿ¢_;?h+ayû+"¶Ê¢jeÆyÐnl¸µéç£^è§éißvîêíê梷¿»öÍ£ajÒ!j÷®×«²Ú(vØ^· -©ì¥ªÞÌjÇq©ð¢¹(¬(®H§ìZ^¶¬¼«y©i®åze¢¶ZrH+¢éÝ'âm¶ÿ]í|©Ç(þíÙ3¦:`þ) :Ø^®:`h!¶Úþ-t¶)ò¦'¢oùÛý³Héø¦ ݶ¬±Êâ¦Ö®¶sb6æ6ÇVFRfÇC´uT6öç7FçG2æS2fwC° ¤uT7&VFRgV÷C²gV÷C²ÂSÂSÂÓÂÓÂb33cµu5õõUÂb33cµu5ôUôÄU$TB¤uT7G&Ä7&VFU267&DF"fײb33²ö&6¶w&÷VæBævbb33²ÂÃÃà ¤uT7G&Ä7&VFU267&DF"fײb33²ô÷FW"æ§rb33²ÂÃÃÃÂÓ ¥vÆR¢uT6WE7FFR5uõ4õr¢6ÆVW¥vVæ@We can see the effect I described before is applied to the second GuiCtrlCreatePic ignoring the first one at all (no transparency)..So we can't GuiCtrlCreate a Pic if we already use a Transparent background ... Another Bug?Is there another way to create Square without pic? (modulable size?) thanks. Sorry for my Bad English. Link to comment Share on other sites More sharing options...
eHrgo Posted July 7, 2007 Author Share Posted July 7, 2007 Can't edit, but the color of "other.jpg" doesn't matter: Sorry for my Bad English. 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