queensoft Posted April 7, 2010 Share Posted April 7, 2010 Simple GUI window. Trying to change background color to black. Using one the three metods, one at a time of course: - GUISetBkColor(0x000000) - $hDC = _WinAPI_GetDC($gui) _WinAPI_SetBkColor($hDC, 0x000000) - $label = GUICtrlCreateLabel("", 0,0, @DesktopWidth, @DesktopHeight) GUICtrlSetBkColor($label, 0x000000) The add JPG over the whole thing: $pic1 = GUICtrlCreatePic($img1, @DesktopWidth/2 - $wi/2, @DesktopHeight/2 - $he/2, 0, 0) The problem is the JPG has transparent pixels and I don't want that. Take a look at attached code and image. JPG image is a simple ordinary JPG. I have tried different color instead of black, same thing happends. #include <WinAPI.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <image_get_info.au3> Opt("GUICoordMode", 1) $img1 = "Image1.jpg" $gui = GUICreate("Slideshow", @DesktopWidth, @DesktopHeight, -1, -1 , BitOr($WS_POPUPWINDOW, $WS_MAXIMIZE)) ; I have tried simple GUI, without style, nothing changed ; comment two methods and leave one running GUISetBkColor(0x000000) ; first method $hDC = _WinAPI_GetDC($gui) _WinAPI_SetBkColor($hDC, 0x000000) ; second method $label = GUICtrlCreateLabel("", 0,0, @DesktopWidth, @DesktopHeight) GUICtrlSetBkColor($label, 0x000000) ; third method $wi = _ImageGetParam(_ImageGetInfo($img1), "Width") $he = _ImageGetParam(_ImageGetInfo($img1), "Height") $pic1 = GUICtrlCreatePic($img1, @DesktopWidth/2 - $wi/2, @DesktopHeight/2 - $he/2, 0, 0) GUISetState(@SW_SHOW, $gui) Do $msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE ;~ _WinAPI_ReleaseDC($gui, $hDC) Exit EndSwitch Until $msg = $GUI_EVENT_CLOSE Link to comment Share on other sites More sharing options...
queensoft Posted April 7, 2010 Author Share Posted April 7, 2010 (edited) I figured it out !! I have Windows 7, also tested on another computer with WIndows 7 - it shows black pixels. On Windows XP (also two tests: real machine and VMWare) it shows no black pixels !! But, how do I get around it ??? Will try and use Win API to display image, will let you know how it goes. Edited April 7, 2010 by queensoft Link to comment Share on other sites More sharing options...
Omertron Posted May 7, 2010 Share Posted May 7, 2010 I get exactly the same issue on Windows 7. Did you find a workaround or fix? 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