Sign in to follow this  
Followers 0
Nova

Gui Nightmare

16 posts in this topic

Ok im back to square 1 I had a Menu script posted here a few days ago which used 2 Gui's to display 2 pictures and then I learnt I only needed 1 Gui.

So ive written the new script using only 1 Gui and its not working !

Ive been through the code over and over again and I cant seem to find a solution to the problem !

Problem:When the picture for the selecting fame named Layer 2.bmp moves up or down a slot on the menu it briefly displays for a nano second and then disapears for gud instead of displaying in its new position like it should.

This problem would be better understood by visual aid so ive uploaded the compiled script and its source !

Would anyone be kind enough to take a look ?

Share this post


Link to post
Share on other sites



I will take a look now.

I'll let you know...

Share this post


Link to post
Share on other sites

- I replaced the many While loops with Select Case

- Removed the GUICtrlDelete and used GUICtrlSetPos (Move the object instead of recreating it each time)

Share this post


Link to post
Share on other sites

Awh so thats what proper code looks like :">

Tnx a million for spending the time to help me out ! :)

Ive only just updated to v3.0.103 and didnt know that Select Case or GUICtrlSetPos eveb existed.

I can already think of aload of uses for Select Case in previous scripts that ive written, im gonna go back and edit then now.

Cheers again,

Nova

Share this post


Link to post
Share on other sites

Ok 1 final problem

Note:Images have be updated to include options and red frame

Problem;Ok the inside of the red frame selector image has (ie all the white must be 100% transparent) so as the otions 1,2 and 3 are still visible while the frame is passing over them.

Can this be done ?

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

If you want to make an image totally (or a part) transparent, you have to do that yourself using an image editor.

I can't help you with that because I don't do image editing.

Edited by SlimShady

Share this post


Link to post
Share on other sites

Ok ive tryed 3 different image editors now.

Ive added transparency to the inside of the frame but when I run the program instead of area being transparent its now black !

Dose autoit support the displaying of images with transparent areas ?

Has anyone ever sucessfully displayed a transparent image, and if so what editor and file format did you use ?

Share this post


Link to post
Share on other sites

Ok ive tryed 3 different image editors now.

Ive added transparency to the inside of the frame but when I run the program instead of area being transparent its now black !

Dose autoit support the displaying of images with transparent areas ?

Has anyone ever sucessfully displayed a transparent image, and if so what editor and file format did you use ?

<{POST_SNAPBACK}>

i've never used .103, but i just downloaded it and installed it to try this out. i was able to get .gif files with transparency to show up in a gui on my second try (cut me some slack, new to this whole gui thing!). i imagine that .ico files would also show up with transparency, but i didn't try this.

i used adobe photoshop and the .gif file type to do this. i'm sure you could use any image editor, though.

if you are using photoshop, whatever is showing up as the white and grey checkerboard will be transparent. make sure you set image -> mode to indexed color when you are finished editting. on the dialog that comes up after picking indexed color, make sure that the check box for transparency is checked (it is by default). then just go to file -> save as and select "CompuServe .GIF (*.GIF)" on the format drop down menu.

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Ok ive just downloaded Adobe Photoshop Cs

Ive edited the pic following ur steps and it appears transparent when its displayed by itself but when I display more that 1 image the section which should appear transparent dosent anymore.

This works (1 Image)

#include <GUIConstants.au3>

$Main = GUICreate("Novacontrol", 250, 272, -1, -1, $WS_POPUP)
$Layer2 = GUICtrlCreatePic("C:\Nova-Menu\Images\Layer 2.gif",63,51, 125,55)
GUISetState (@SW_SHOW)

While 1
   Sleep(100)
Wend

(This dosent work 2 images)

#include <GUIConstants.au3>

$Main = GUICreate("Novacontrol", 250, 272, -1, -1, $WS_POPUP)
$Layer1 = GUICtrlCreatePic ("C:\Nova-Menu\Images\Layer 1.bmp", -1, -1, 250, 272)
$Layer2 = GUICtrlCreatePic("C:\Nova-Menu\Images\Layer 2.gif",63,51, 125,55)
GUISetState (@SW_SHOW)

While 1
   Sleep(100)
Wend

Plz find attached both pictures for testing purposes !

Is this a bug ?

Edited by nova

Share this post


Link to post
Share on other sites

ah, i don't know enough to say wether this is a bug or not. transparency definitely does work with one image, but as you said, with a second image it does not work.

i tried with two .gifs also. same thing. the first one drawn works fine, but when another is drawn on top of the first, the transparency of the second does not take the first image into consideration. the second image does take the gui background color into consideration, though (the GUISetBkColor(0xE0FFFF) from the GUICtrlCreatePic() example showed up properly on both images).

it is entirely possible that what you want isn't possible in this manner. or maybe it is just some simple command i don't know about.

a couple work arounds:

1. make the part you want transparent on the top image the same as the piece below it, basically fake it.

2. if you want a red rectangle with a transparent middle, maybe you could just draw the four sides one at a time. you would only need one image for a side and one image for the top/bottom. then draw each piece twice in the appropriate spot.

perhaps someone else could better answer this question? (someone who has used the gui longer than the couple hours i have).

Share this post


Link to post
Share on other sites

Tnx for the reply brotherhobbes

Believe me I know of alot of work arounds that could act as a quick fix for this problem but there meerly tricks of the eye and I hate doing that it just feels so cheep and also it invites further possible graphic problems :)

I would really like to find out if this is a bug and if autoit's source code could be edited to solve this issue !

Cheers again for ur help

Nova

Share this post


Link to post
Share on other sites

I have heard it said before, that the reason AutoIt can't do transparency isn't because of the language... But because it is a Windows limitation. Please correct me if I am wrong.

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

I have heard it said before, that the reason AutoIt can't do transparency isn't because of the language... But because it is a Windows limitation. Please correct me if I am wrong.

<{POST_SNAPBACK}>

I think that's true.

I read something about the next Windows release.

You'll be able to make everything transparent.

You can overlap transparent controls without seeing strange unwanted colors.

But that's future music.

I'm interested too. I talked to a friend of mine and he told me that you can make the background of a GUI transparent.

When you do that you can use transparent images to create a GUI with whatever shape you want.

Like WinAmp skins.

This is what he said in short: "set the opacity of the GUI/program to 0%"

I tried WinSetTrans, but it didn't work.

Summary:

What you want is possible but currently not with AutoIt.

Edited by SlimShady

Share this post


Link to post
Share on other sites

When you do that you can use transparent images to create a GUI with whatever shape you want.

Like WinAmp skins

Thats what I was eventually hoping to do create a really weird shapped gui !

Summary:

What you want is possible but currently not with AutoIt.

So could the c++ devs here impliment such features into autoit ? :)

Im sure there are more that just the 2 of us that could find great uses for such features !

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

If dllcall were able to have structures, then any shaped window would be possible. I have the exact code needed, but until this is possible, nobody will be able to do this. HINT: Since most of what goes into autoit is more or less a popularity contest, maybe we can bug Jon, Valik and Larry to get their heads together and get this up and running. There are some seemingly insurmountable obstacles in getting this to work, so it would take an overwhelming majority of autoit users to get them to do it.

EDIT: (Spelling)

Edited by this-is-me

Who else would I be?

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

So are you guys up for the challenge then ?

Let the bugging commence :)

Edited by nova

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