Transparent replicants

Hi,

i’m doing some experiments with programming replicants. I’ve searched on how to make replicants transparent, but couldn’t find any information. The previous newsletter talks about making them transparent while draggeng them, and i’ve come across this app (http://www.bebits.com/app/2638) wich actually creates transparent replicants. So it is possible. Only problem is I don’t know where to start.

Can anyone point me in the right direction?

It’s not really possible to do it nicely - you have to make yourself invisible, grab a BBitmap of the portion of the desktop your view will cover (there are methods in BScreen for that), and set that as your view bitmap (view->SetViewBitmap() IIRC).

It’s not nice, and you have to keep updating the background bitmap if things change (move workspaces etc) At least for replicants things shouldn’t be able to move underneath each other, so it may be slightly better.

Note it won’t let you have two replicants that partially overlap each other, which both want to update - it’s a hack that’s for purely eye-candy purposes only.

I could have guessed it was some dirty hack like that… But at least it’s something :smiley:

Thanx for your info

BTW, will Haiku R1 have native support for transparent windows? Or is this a feature for the long term?

I’m pretty sure it won’t be in R1.

Thinking about the transparency, maybe with replicants you can access the BView of your container, and from there get the ViewBitmap/ViewColor and use that directly. That would definately be a nicer way of doing things, although it sould still be fake transparency it wouldn’t require you making the replicant invisible to grab a screenshot.

You can work out which way the app you’ve seen does things by switching it to a different workspace and seeing if it disappears for a few seconds.