Phantomasss Posted May 19, 2009 Share Posted May 19, 2009 Hello, i create my first GUI from .gif images. There is a lot of problems, i hope you will help and we all will discuss...Create GUI:#include <WindowsConstants.au3> #include <GUIConstants.au3> $gui = GUICreate("", 120, 60, -1, -1, BitOR($WS_POPUP, $WS_VISIBLE, $WS_CLIPSIBLINGS), $WS_EX_TOOLWINDOW) GUISetState (@SW_SHOW, $gui) While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WendOk, done:I created skin for my programm:Now i add background:#include <WindowsConstants.au3> #include <GUIConstants.au3> $gui = GUICreate("", 120, 60, -1, -1, BitOR($WS_POPUP, $WS_VISIBLE, $WS_CLIPSIBLINGS), $WS_EX_TOOLWINDOW) ;Backgorund GUICtrlCreatePic(@ScriptDir & "\background.gif", 0, 9, 120, 51) GUISetState (@SW_SHOW, $gui) While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WendBackground added:This is 1st problem:That it? AutoIt bug? How to fix it? (Left in my project, Right in GUI).Ok , next i add "title" for my programm:#include <WindowsConstants.au3> #include <GUIConstants.au3> $gui = GUICreate("", 120, 60, -1, -1, BitOR($WS_POPUP, $WS_VISIBLE, $WS_CLIPSIBLINGS), $WS_EX_TOOLWINDOW) ;Title Image GUICtrlCreatePic(@ScriptDir & "\title.gif", 0, 0, 120, 9, -1, $GUI_WS_EX_PARENTDRAG) ;Backgorund GUICtrlCreatePic(@ScriptDir & "\background.gif", 0, 9, 120, 51) GUISetState (@SW_SHOW, $gui) While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WendResult:Not bad on the face of it. Here 2rd problem: 2 pixels transparent (.gif files not transparent):In project:In GUI:How to fix it?Next i want add button for close my GUI (). Code:#include <WindowsConstants.au3> #include <GUIConstants.au3> $gui = GUICreate("", 120, 60, -1, -1, BitOR($WS_POPUP, $WS_VISIBLE, $WS_CLIPSIBLINGS), $WS_EX_TOOLWINDOW) ;Button 1 $close = GUICtrlCreatePic(@ScriptDir & "\button1.gif", 112, 2, 6, 6) ;Title Image GUICtrlCreatePic(@ScriptDir & "\title.gif", 0, 0, 120, 9, -1, $GUI_WS_EX_PARENTDRAG) ;Backgorund GUICtrlCreatePic(@ScriptDir & "\background.gif", 0, 9, 120, 51) GUISetState (@SW_SHOW, $gui) While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If $msg = $close Then Exit WendResult:This 3rd problem (as well as 2).In project:In GUI:http://img222.imageshack.us/img222/320/60228016.gifAnd 4th problem here. It works with any window:http://img98.imageshack.us/img98/442/70412073.gifHow to fix all problems?Arichive with a project in attachment. Please help me... Thanks!mygui.rar Link to comment Share on other sites More sharing options...
BrettF Posted May 19, 2009 Share Posted May 19, 2009 What is the end result meant to be with the GUI? I understand it is skinned but what else? Your problem confuses me... Why use transparent .gif? Why not use JPG images? Why not use a whole PNG image and do it that way? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Phantomasss Posted May 19, 2009 Author Share Posted May 19, 2009 What is the end result meant to be with the GUI? I understand it is skinned but what else?I described all of problems:Why use transparent .gif?All used .gif images NOT transparent 100%. For them not 255 colors, but less than, possibly from it appears bug with transparency.Why not use JPG images?JPG images have artefacts..gif images have a less size..gif images well excellent for such GUI.Why not use a whole PNG image and do it that way?My GUI not use alpha-channel. .png not necessity this.Thanks for fast reply... Link to comment Share on other sites More sharing options...
jvanegmond Posted May 19, 2009 Share Posted May 19, 2009 Hello, both .gif and .png have an optional alpha channel. PNG-8 is better than GIF and does the same. github.com/jvanegmond Link to comment Share on other sites More sharing options...
Mahesh1 Posted May 19, 2009 Share Posted May 19, 2009 Works like a charm if you use .jpg Link to comment Share on other sites More sharing options...
Phantomasss Posted May 19, 2009 Author Share Posted May 19, 2009 You compel me to go away from problems but not decide them . Link to comment Share on other sites More sharing options...
Mahesh1 Posted May 19, 2009 Share Posted May 19, 2009 You compel me to go away from problems but not decide them .Sorry, i was not compelling you. Open an paint and try to save into Gif. You get a message as color loss....! wanna continue? I think that reduces the quality of the image. But since i tried different ways i felt its due to Gif. Link to comment Share on other sites More sharing options...
Zedna Posted May 19, 2009 Share Posted May 19, 2009 Look herehttp://www.autoitscript.com/forum/index.ph...st&p=679445There is very similar problem. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Phantomasss Posted May 20, 2009 Author Share Posted May 20, 2009 Sorry, i was not compelling you. Open an paint and try to save into Gif. You get a message as color loss....! wanna continue? I think that reduces the quality of the image. But since i tried different ways i felt its due to Gif.Paint as a palette uses "System (Windows)" or alike. In this palette contained different colors:In all them 256. AutoIt fine works with palettes in 256/256 colors, all ok.At saving in .gif i use "Exact" palette (Photoshop). Due to it possible to save .gif image without losses (not more than 256 colors):AutoIt badly works with incomplete () palettes (3/256 colors). It must be fixed...If skin of my programm consisted of 256/256 colors, all would be ok.Look herehttp://www.autoitscript.com/forum/index.ph...st&p=679445There is very similar problem.Yes, my project does not move up from this bug. Link to comment Share on other sites More sharing options...
Phantomasss Posted May 20, 2009 Author Share Posted May 20, 2009 Hmm... i fixed it. It is necessary to fill empty colors () by other colors (ffffff to 000000), example:It works! Bug with transparency of pixels is fixed...And there is the last problem:How to fix? Thanks... Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 20, 2009 Moderators Share Posted May 20, 2009 Phantomasss,I freely admit not being too knowledgable in this area, but I believe you need to send a message to redraw your GUI. Try creating a $tagRECT structure for your button:$tDraw = "int " & 112 & "; int " & 2 & "; int " & 118 & "; int " & 8and adding this to your While...WEnd loop:If Not WinActive($gui) Then _WinAPI_RedrawWindow($gui, $tDraw)No doubt someone will come along with a better solution - but that worked for me.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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