473,770 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Have you any idea how to make window transparent using pygame?

Hello everybody!

I just want to make window transparent. ;) At this moment I've found
only ideas of taking screenshots to make background... Anything else?

Thanks for help!

Jan 30 '06 #1
2 4524
On 30 Jan 2006 08:52:04 -0800
"kishkin" <ki*****@gmail. com> wrote:
I just want to make window transparent. ;) At this moment
I've found only ideas of taking screenshots to make
background... Anything else?


You are looking for "alpha" surfaces. In a full RGBA
surface, the "A" or "alpha" represents the degree of
transparency of the surface for each pixel. There is also
such a thing as a per-surface alpha, etc.

The documentation can be had from the PyGame website at
http://www.pygame.org. You will also find a link to a
PyGame-specific mailing list, which is really the best place
to ask about this sort of thing.

--
Terry Hancock (ha*****@Anansi Spaceworks.com)
Anansi Spaceworks http://www.AnansiSpaceworks.com

Jan 30 '06 #2
Terry Hancock schrieb:
On 30 Jan 2006 08:52:04 -0800
"kishkin" <ki*****@gmail. com> wrote:
I just want to make window transparent. ;) At this moment
I've found only ideas of taking screenshots to make
background... Anything else?


You are looking for "alpha" surfaces. In a full RGBA
surface, the "A" or "alpha" represents the degree of
transparency of the surface for each pixel. There is also
such a thing as a per-surface alpha, etc.

The documentation can be had from the PyGame website at
http://www.pygame.org. You will also find a link to a
PyGame-specific mailing list, which is really the best place
to ask about this sort of thing.


That alone won't help. First of all, the alpha only is applied to the
contents of the pygame window - so you need to capture the background
behind that first and put it in the window as background. But if that
background changes, you won't be notified.

But that still won't rid you of the window decorations...
I guess one could do that with OS-specific calls to window-handles or
the like (and in PyObjc its a no-brainer, as the Mac windowing-system
supports that natively)

But in pygame, there is no API for that.

Regards,

Diez
Jan 30 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
16145
by: Marian Aldenhövel | last post by:
Hi, I am trying to make pygame play music on windows. This simple program: import pygame,time pygame.init() print "Mixer settings", pygame.mixer.get_init() print "Mixer channels", pygame.mixer.get_num_channels() pygame.mixer.music.set_volume(1.0) pygame.mixer.music.load('file1.mp3)
0
1500
by: Never Best | last post by:
hello, I was curious if someone here could help... I basically want to put a transparent window infront of a fullscreen application and keep drawing text onto the transparent window (basically the transparent window wont affect the fullscreen application in anyway, just use to display information). The fullscreen application is an external program. I've tried using the "setTopMost" but it only puting the window I created above all the...
23
1642
by: Skipper | last post by:
Hi All, I am going to try and learn Python because I want to write at least one program to help my disabled son with communitation. I am not asking for anyone to do this for me I simply want to know if I can do what I need to do with Python .... Basically the program will blank the screen and call up (for example) 6 pictures. A flashing border with travel from picture to picture.
1
2530
by: yuban | last post by:
I am trying ( so far in vain ) to display a normal looking ( non-transparent ) control in a transparent window. I am attempting this in C++, on Vista ( argh ), and having no luck at all. Our transparent window has been accomplished with the infamous "DwmExtendFrameIntoClientArea()" call, which of course implies that "composition" is enabled. If someone can tell me how to simply render an icon or bitmap so that it is not see-through, I would...
0
1486
by: Grant Edwards | last post by:
I've got a system where I try to install extensions using /usr/local/bin/python setup.py install But, it fails when it tries to use a non-existant compiler path and specs file. I suspect it's trying to use the compieler that was used to build /usr/bin/python. How do I get it to use the compiler settings that were used for /usr/local/bin/python?
1
1428
by: joshuabraham | last post by:
os version =windows xp hi guys i'm having problems using pygame the following code just does not seem to work. clock=pygame.time.Clock() while True: sound1.play() clock.tick(60) pKeys = pygame.key.get_pressed() Eves=pygame.event.get() villian.face() villian.hert()
3
4424
by: globalrev | last post by:
im doing this : http://www.learningpython.com/2006/03/12/creating-a-game-in-python-using-pygame-part-one/ and when closing the program the window stays up and doesnt respond. i tried adding this: http://www.pygame.org/wiki/FrequentlyAskedQuestions bu it doesnt work, or maybe im doing it wrong. heres the code without the added tutorial exit:
11
11681
by: globalrev | last post by:
http://www.pygame.org/docs/ref/mixer.html import pygame #pygame.mixer.init(frequency=22050, size=-16, channels=2, buffer=3072) //it complained abiout words= so i guess its only the nbrs should be there// pygame.mixer.init(22050, -16, 2, 3072) pygame.mixer.music.load("example1.mp3")
5
3038
by: defn noob | last post by:
Im using PyGame to draw images of graphs and trees. Howver right now i am looping using: while 1: for event in pygame.event.get(): if event.type == pygame.QUIT: sys.exit() screen.fill(screencolor) pygame.draw.circle(screen, linecolor, (500, 20), 12, 0)
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9910
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.