Sign in to follow this  
Followers 0
Markus

Icon - transparent colour

13 posts in this topic

Hi!

I have a little Icon problem.

I have an Icon with a transparent Colour. But if the icon is over a picture in the GUI, i don't see the part of the picture that is beyond the transparent colour.

I hope you can help me.


"It's easier to disintegrate an atom than a prejudice." (A.Einstein)---------------------------------------------------------------------------My C++ - tools:Tidy tool-->indents your c++ sourceCleanscript --> cleans autoit-code before compiling (co-author: peethebee)My tools:GUIBuilder-->build your window and get the source; german versionMy Games:OnlineGameCenter-->Online Chess and Connect4 with a rtf-chatSnake-->including a level editor to build your own levelsTetris-->the well known game, big funOther things:Tower of Hanoi-->perfect riddler with graphic output

Share this post


Link to post
Share on other sites



Hi!

I have a little Icon problem.

I have an Icon with a transparent Colour. But if the icon is over a picture in the GUI, i don't see the part of the picture that is beyond the transparent colour.

I hope you can help me.

would be a good idea to supply a script to duplicate this problem and the images


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Right

#include <GUIConstants.au3>

GUICreate("",400,400)

GUISetState()

GUICtrlCreatePic(@ScriptDir & "\feld_schwarz.bmp",20,20,70,70 )

GUICtrlCreatePic(@ScriptDir & "\feld_schwarz.bmp",200,200,100,100)

$ico=GUICtrlCreateIcon(@ScriptDir & "\schachfigur_turm.ico",-1,220,220,70,70)

$stop=GUICtrlCreateButton("stop",200,20,100,20)

$weiter=GUICtrlCreateButton("go on",200,50,100,20)

$neu=GUICtrlCreateButton("new",200,80,100,20)

Sleep(1000)

$ico=GUICtrlCreateIcon(@ScriptDir & "\schachfigur_turm.ico",-1,140,140,70,70)

$x=140

$y=140

While 1

GUICtrlSetPOs($ico,$x,$y)

$x=$x-1

$y=$y-1

Sleep(10)

$msg=GUIGetMsg()

If $msg=$GUI_EVENT_CLOSE Then Exit

If $msg=$neu Then

$x=140

$y=140

EndIf

If $msg=$stop Then

While 1

$msg=GUIGetMsg()

If $msg=$weiter Then ExitLoop

If $msg=$GUI_EVENT_CLOSE Then Exit

WEnd

EndIf

WEnd

And the Pic/Icon

The_Pics.zip


"It's easier to disintegrate an atom than a prejudice." (A.Einstein)---------------------------------------------------------------------------My C++ - tools:Tidy tool-->indents your c++ sourceCleanscript --> cleans autoit-code before compiling (co-author: peethebee)My tools:GUIBuilder-->build your window and get the source; german versionMy Games:OnlineGameCenter-->Online Chess and Connect4 with a rtf-chatSnake-->including a level editor to build your own levelsTetris-->the well known game, big funOther things:Tower of Hanoi-->perfect riddler with graphic output

Share this post


Link to post
Share on other sites

I just noticed a little mistake in the code, the first $ico=GUICtrlCreateIcon(...) shouldnt have this id ($ico), just remove it plz. By the way it has no effect on the script.

The problem still consists. The Icon is transparent (except the towerpart in the middle of course), so i should see what is behind, shouldn't i?


"It's easier to disintegrate an atom than a prejudice." (A.Einstein)---------------------------------------------------------------------------My C++ - tools:Tidy tool-->indents your c++ sourceCleanscript --> cleans autoit-code before compiling (co-author: peethebee)My tools:GUIBuilder-->build your window and get the source; german versionMy Games:OnlineGameCenter-->Online Chess and Connect4 with a rtf-chatSnake-->including a level editor to build your own levelsTetris-->the well known game, big funOther things:Tower of Hanoi-->perfect riddler with graphic output

Share this post


Link to post
Share on other sites

Noone knows a solution? :o

It's normal that transparent colours of icons dont work in autoit?

I wanted to write a chess game, the field exists of black and white pics, but i dont see those pics, beyond the figure's transparent colour.

Is there a chess game in this forum alrdy, that could help me?


"It's easier to disintegrate an atom than a prejudice." (A.Einstein)---------------------------------------------------------------------------My C++ - tools:Tidy tool-->indents your c++ sourceCleanscript --> cleans autoit-code before compiling (co-author: peethebee)My tools:GUIBuilder-->build your window and get the source; german versionMy Games:OnlineGameCenter-->Online Chess and Connect4 with a rtf-chatSnake-->including a level editor to build your own levelsTetris-->the well known game, big funOther things:Tower of Hanoi-->perfect riddler with graphic output

Share this post


Link to post
Share on other sites

Noone knows a solution? :o

It's normal that transparent colours of icons dont work in autoit?

I wanted to write a chess game, the field exists of black and white pics, but i dont see those pics, beyond the figure's transparent colour.

Is there a chess game in this forum alrdy, that could help me?

I did try to help you, but here's what I ended up finding out http://www.autoitscript.com/forum/index.ph...ndpost&p=154852


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Thank you very much, peter and gafrost, i alrdy thought nobody would help me.

@gafrost: i watched your test script (thank you), but whats that $GUI_BKCOLOR_TRANSPARENT. When i tried it, the variable caused a mistake. Don't i have the latest version?? Or was it just an idea of you for a new variable in the next update??

@peter: funny script^^ i think that could help, ill try to understand what the dll function is exactly doing, maybe ill have more questions tomorrow :o Would this dll funciton also work for a chessfigure picture, that moves over the field?

And one more point, which editor would u prefer for reading *.dll, i have noone, that can read dlls, maybe u can say me one, otherwise ill search this rly great forum :geek:


"It's easier to disintegrate an atom than a prejudice." (A.Einstein)---------------------------------------------------------------------------My C++ - tools:Tidy tool-->indents your c++ sourceCleanscript --> cleans autoit-code before compiling (co-author: peethebee)My tools:GUIBuilder-->build your window and get the source; german versionMy Games:OnlineGameCenter-->Online Chess and Connect4 with a rtf-chatSnake-->including a level editor to build your own levelsTetris-->the well known game, big funOther things:Tower of Hanoi-->perfect riddler with graphic output

Share this post


Link to post
Share on other sites

Thank you very much, peter and gafrost, i alrdy thought nobody would help me.

@gafrost: i watched your test script (thank you), but whats that $GUI_BKCOLOR_TRANSPARENT. When i tried it, the variable caused a mistake. Don't i have the latest version?? Or was it just an idea of you for a new variable in the next update??

@peter: funny script^^ i think that could help, ill try to understand what the dll function is exactly doing, maybe ill have more questions tomorrow :o Would this dll funciton also work for a chessfigure picture, that moves over the field?

And one more point, which editor would u prefer for reading *.dll, i have noone, that can read dlls, maybe u can say me one, otherwise ill search this rly great forum :geek:

I have $GUI_BKCOLOR_TRANSPARENT in Beta

From gafrost / Gary: APIViewer2004


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Oh I havent had the latest version :o

Now gafrosts test script worked.

Thx for Api Viewer, Api Viewer is also for dlls?

Edited by Markus

"It's easier to disintegrate an atom than a prejudice." (A.Einstein)---------------------------------------------------------------------------My C++ - tools:Tidy tool-->indents your c++ sourceCleanscript --> cleans autoit-code before compiling (co-author: peethebee)My tools:GUIBuilder-->build your window and get the source; german versionMy Games:OnlineGameCenter-->Online Chess and Connect4 with a rtf-chatSnake-->including a level editor to build your own levelsTetris-->the well known game, big funOther things:Tower of Hanoi-->perfect riddler with graphic output

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Markus,

The trasparent region should do exactly what you want.

I have no idea how to read DLLs.

Do not expect that there will be a lot of people just waiting to answer your questions when you post them. Most people have other more important things they should be doing.

Edited by peter1234

Share this post


Link to post
Share on other sites

The trasparent region should do exactly what you want.

Not rly, because i wanted a transparent region for a picture and if i understood the function it sets a transparent region for a window "SetWindowRgn" and not for a picture in a gui-window.

I think you havent understood my problem.

Do not expect that there will be a lot of people just waiting to answer your questions when you post them. Most people have other more important things they should be doing.

sorry i just thought that i can ask in the "Support"-Forum

you seem to be one of those people who have to do something more important, k thank you for your help so far, i'll think ill have to try it alone...


"It's easier to disintegrate an atom than a prejudice." (A.Einstein)---------------------------------------------------------------------------My C++ - tools:Tidy tool-->indents your c++ sourceCleanscript --> cleans autoit-code before compiling (co-author: peethebee)My tools:GUIBuilder-->build your window and get the source; german versionMy Games:OnlineGameCenter-->Online Chess and Connect4 with a rtf-chatSnake-->including a level editor to build your own levelsTetris-->the well known game, big funOther things:Tower of Hanoi-->perfect riddler with graphic output

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

Not rly, because i wanted a transparent region for a picture and if i understood the function it sets a transparent region for a window "SetWindowRgn" and not for a picture in a gui-window.

I think you havent understood my problem

Perhaps I did not understand. In which case I am sorry for wasting your time. Then again, perhaps you did not understand. In which case I will try to help you understand... Each transparent region is a small window that has an image in it with a transparent background. There can be many of these windows. The windows can be moved anywhere on top of a background image (or anyhing else, even other transparent regions) and the image in the window will be on top with the image under the window showing through the transpartnet part of the window. Thus each window is like an icon with a transparent background. Isn't that what you wanted? I am not an experienced programer. There may be a better way of doing what you want, but that is the only way I can think of. Sorry if it does not help.

Edited by peter1234

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