qwertt Posted September 12, 2011 Share Posted September 12, 2011 Hallo, I just recently tries to build a GUI, but I ran into a problem, which is most certainly amistake on my part, but I just can't find the reason. Was I wanted, was a black plate, with an image on top (on the left side), nothing more Was I did wasGUICreateGUISetBkColor(black)GUICtrlCreatePicBut no some of my image has holes an I see the black from underneath, just like my pictures has holes ode some freaky kind of transparency I don't want.Oh and if it matters, I rin Win7(64). Can you help me ? TNX #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 613, 306, 192, 132) GUISetBkColor(0x000000) $Pic1 = GUICtrlCreatePic("C:\Tools\x+.jpg", 0, 0, 461, 306) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Link to comment Share on other sites More sharing options...
taietel Posted September 12, 2011 Share Posted September 12, 2011 Try to disable the picture: put just under the GuiCtrlCreatePic(...) GUICtrlSetState($Pic1, $GUI_DISABLE) Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text Link to comment Share on other sites More sharing options...
qwertt Posted September 12, 2011 Author Share Posted September 12, 2011 Does not change anything. I found a quick, but dirty workaround by not making the background black and add one empty GUICtrlCreateLabel next to the picture, which I made black by using GUICtrlSetBkColor(-1, $Gui_color_BK). Works, looks good, but still I wounder why GUISetBkColor destroys my jpg Link to comment Share on other sites More sharing options...
monoscout999 Posted September 12, 2011 Share Posted September 12, 2011 edit the picture to remove transparencies Link to comment Share on other sites More sharing options...
qwertt Posted September 12, 2011 Author Share Posted September 12, 2011 Its a regular JPG, I even converted it to BMP, same problem. I doubt that it has a transparency! Link to comment Share on other sites More sharing options...
monoscout999 Posted September 13, 2011 Share Posted September 13, 2011 upload the picture and let us run some tests. Link to comment Share on other sites More sharing options...
qwertt Posted September 13, 2011 Author Share Posted September 13, 2011 OK, for demonstration purposes I have cut the relevant part of the JPG.Its quite small, now but easy to see... For some strange reason imageshack changed the name of my upload,please not that if you try my minimalistic code. Link:http://imageshack.us/photo/my-images/854/71713711.jpg/ for me the result is this: http://imageshack.us/photo/my-images/18/resultek.jpg/ Link to comment Share on other sites More sharing options...
UEZ Posted September 13, 2011 Share Posted September 13, 2011 (edited) I got the same effect. Try this way instead: #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GDIPlus.au3> _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile("Test.jpg") $hBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) _GDIPlus_ImageDispose($hImage) $Form1 = GUICreate("Form1", 613, 306, 192, 132) GUISetBkColor(0x000000) $Pic1 = GUICtrlCreatePic("", 0, 0, 0, 0) _WinAPI_DeleteObject(GUICtrlSendMsg($Pic1, 0x0172, 0, $hBmp)) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE _WinAPI_DeleteObject($hBmp) _GDIPlus_Shutdown() Exit EndSwitch WEnd Br, UEZ Edited September 13, 2011 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
qwertt Posted September 13, 2011 Author Share Posted September 13, 2011 TNX, this kind of works. but it seams a lot of vodoo to get to that result. Did I ran into a bug or is my result a suppose to happen. Should I submit a Bug report? 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