maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Gtk image transparencies (https://talk.maemo.org/showthread.php?t=32309)

xmob 2009-09-30 21:49

Gtk image transparencies
 
Bear with me here, there's many firsts:
My first Maemo app
My first Python app
My first Gtk app

As you can see, the odds are stacked against me. Anyway, I'm building a Windows SideShow application. I'm using the universal driver which means no Windows side code. I've got the protocol handling working fine (Bluetooth for now) and getting all the relevant data.

Part of the data obtained is a gadget icon. This is supposed to be a 32bpp with alpha-channel bitmap. I can display the icon in a Gtk button no problem, but it has a black background. Is there anyway to extract the alpha-channel and use it?

nymajoak 2009-09-30 23:17

Re: Gtk image transparencies
 
I can't help but just had to say that is a great idea for an application!

xmob 2009-10-01 00:00

Re: Gtk image transparencies
 
Thanks for the support! :)

Anyway, I've sort of found a solution. It's less than ideal, but I've noticed that all the icons have a solid black background. So I was able to use add_alpha to at least eliminate the horrible black background:

Code:

pixbuf = pixbuf.add_alpha(True, chr(0), chr(0), chr(0))

xmob 2009-10-01 01:49

Re: Gtk image transparencies
 
1 Attachment(s)
It's got a long way to go, but this is where I'm at so far:

Attachment 4199

xmob 2009-10-04 15:48

Re: Gtk image transparencies
 
1 Attachment(s)
I was REALLY struggling with GTK. Had I known that pygame was available on Maemo sooner, I'd have started with that. :mad:

Anyway, the switch to pygame has been made and my app now looks like this:
Attachment 4262

jaysin22 2009-10-04 16:59

Re: Gtk image transparencies
 
This looks like a really cool app. Any info on the exact uses and what your future plans are. How does it hook up with Windows Side Show exactly?

xmob 2009-10-04 18:56

Re: Gtk image transparencies
 
You can find out more information about SideShow here.

My app uses the SideShow universal driver. The great thing about this is that nothing needs doing on the Windows side. It detects a sideshow device and automagically installs the drivers.

The app currently connects by Bluetooth, but the universal driver also supports network and USB connections. I plan to eventually include network support, but that uses pnp-x (a Microsoft bolt on to uPNP) and means some extensive coding. :mad:

I'm thinking, at this stage, that I should maybe post a Work In Progress thread in another area of the forums and get comments/feedback.


All times are GMT. The time now is 05:29.

vBulletin® Version 3.8.8