Jump to content

unwanted holes in my picture


qwertt
 Share

Recommended Posts

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
Link to comment
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:

Link to comment
Share on other sites

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

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...