Sign in to follow this  
Followers 0
qwertt

unwanted holes in my picture

9 posts in this topic

Hallo,

I just recently tries to build a GUI, but I ran into a problem, which is most certainly a

mistake 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 :graduated:

Was I did was

  • GUICreate
  • GUISetBkColor(black)
  • GUICtrlCreatePic
But 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

Share this post


Link to post
Share on other sites



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 :graduated:

Share this post


Link to post
Share on other sites

edit the picture to remove transparencies

Share this post


Link to post
Share on other sites

Its a regular JPG, I even converted it to BMP, same problem.

I doubt that it has a transparency!

Share this post


Link to post
Share on other sites

upload the picture and let us run some tests.

Share this post


Link to post
Share on other sites

#8 ·  Posted (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 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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0