Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / see through background

Author
Message
Code eater
17
Years of Service
User Offline
Joined: 17th Feb 2008
Location: Behind You!
Posted: 8th Nov 2008 16:01 Edited at: 8th Nov 2008 17:37
is it possible to make the background to a program invisible so for example with this clock program:



all the black bit in the background would be invisible. I suspect I cannot do this but it would be very useful.

cheers,,,

codeeater
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 8th Nov 2008 20:33
Do you mean so you can see the Windows desktop through the prgram window? If you mean seeing other DB elements, just capture the screen and make it a sprite with transparency or just draw those circles on top of whatever else is being displayed, or copy the screen as an image and texture a plain, ghost it or set it for transparency (in the cases of capturing the screen, draw it to a separate bitmap before capturing it).

Enjoy your day.
Code eater
17
Years of Service
User Offline
Joined: 17th Feb 2008
Location: Behind You!
Posted: 9th Nov 2008 10:06
Sorry that was a bit unclear, what I ment was as you said to see the desktop (or other programs running) through the program window so you would just see the circles.

Thanks,,,

Codeeater
Jmahmood
18
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: not sure
Posted: 9th Nov 2008 16:02
At first you set the window on and scale it.Minimize might also work instead of scaling the window,i'm not sure.


Take a screenshot


Restore the window settings and make a plain which will cover your screen and then texture it with the screenshot you took.

BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 9th Nov 2008 21:50
I would imagine that that wouldn't work well for any kind of real time environment.

Ever notice how in Microsoft word, the word "microsoft" is auto corrected to be "Microsoft" but "macintosh" just gets the dumb red underline?
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 9th Nov 2008 23:32
@bat out of hell
wont that just take a screenshot of whatever is inside the DB window?

A small program that works is better than a large one that doesn't.

DBC Challenge Rank: Rookie
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 10th Nov 2008 00:45
Actually, it's quite ingenious! bat out of hell, where did you learn that hiding the window and saving the bitmap would capture screen 0 ?

Here's a variation of the idea. It's not real time, but creates a pretty cool illusion of a box on a matrix in a transparent window where you can see the desktop. Move with the arrow keys and steer with the mouse.

I use the winapi to detect the size and depth of whatever desktop this is run on. In order to have sized windows and the correct desktop area, more use of the winapi can do the trick though I think using the plain can work as long as the capture is the proper size and depth and the plain lighting is adjusted so it's not too dark. DBC 1.20 has set object emissive which works nicely. The plain would also have to be shifted to reveal only the part of the background that the DBC window is over.

Anyway, heres the illusion example:



Enjoy your day.
Jmahmood
18
Years of Service
User Offline
Joined: 3rd Apr 2007
Location: not sure
Posted: 10th Nov 2008 17:28 Edited at: 10th Nov 2008 17:31
Quote: "Actually, it's quite ingenious! bat out of hell, where did you learn that hiding the window and saving the bitmap would capture screen 0 ?"


I once tried to make a FRAPS like software with DBC.The idea worked but it was damn slow.

EDIT: your little trick rocks!!

Quote: "wont that just take a screenshot of whatever is inside the DB window?"

Nope.It captures your entire screen.

Quote: "I would imagine that that wouldn't work well for any kind of real time environment."


Yes...it wouldn't.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 11th Nov 2008 13:40
Quote: "Nope. It captures your entire screen."

Serves me right for being too lazy to test it

A small program that works is better than a large one that doesn't.

DBC Challenge Rank: Rookie
Code eater
17
Years of Service
User Offline
Joined: 17th Feb 2008
Location: Behind You!
Posted: 11th Nov 2008 18:56
thats pretty cool latch,,, thanks guys,,,

But since that just takes a background image once i don't think that'll serve my purpose but that could come in really usefull elsewhere.

Cheers,,,

Codeeater
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 12th Nov 2008 04:17
A real way to do this migh be with setting regions within the DBC window to visible or not. Also, using GDI, one can screen capture and paint the background of windows using dlls. These method can get a little more complicated depending on what you want to do, but it's all possible.

But, I was impressed with the idea bat out of hell suggested and not quite ready to give up on that. I put together another example that uses the same premise as the previous one. The difference is, I call a refresh of the background whenever a window changes so it helps the illusion.

I pulled out my old bouncing clock code, and added it to the transparency routine and came up with a pretty cool example. The window can be sized and maximized, but if it is minimized, there will be an error. Has something to do with the bitmap size. Anyway, it's designed to keep the transparent window above all of the rest. Whenever you switch windows, it will flash, this is because of the updating of the background - keeps it somewhat real time... The example is attached:

Enjoy your day.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2025-06-07 17:04:40
Your offset time is: 2025-06-07 17:04:40