Sign in to follow this  
Ishraam

[java] Drawing without 'container' like a Frame

Recommended Posts

Hello guys ^_^ Here is my problem : I want to draw on my screen, in half transparency, an image A. I said 'on the screen' cause I do not want to draw it in a some kind of window (Frame or other)! The goal is simply to have a webcam images flow rendered anytime on my screen, and in half transparency so that I can still do something else -like reading posts frlom GameDev! Hope you can help!

Share this post


Link to post
Share on other sites
Hoo,

I think this can be done, since I can get the main GraphicsDevice (the parent, i.e. my 'screen') with :

GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice graph_device= ge.getDefaultScreenDevice();

Now the problem is how do I draw on it... ?

Share this post


Link to post
Share on other sites
With the default Java libraries it can't be done, you MUST have a window of some type to draw on, Java does not allow access to the screen itself.

There may be a 3rd party library, however. Who knows what some diligent, unemployed soul has created to satiate his or her taste for tinkering.

Share this post


Link to post
Share on other sites
Quote:

With the default Java libraries it can't be done, you MUST have a window of some type to draw on, Java does not allow access to the screen itself.

Yes but a window can be borderless (and backgroundless if I remember well). If you size it up to screen size you're on your way. If I remember well I did this with the AWT Window class.

Greetz,

Illco

Share this post


Link to post
Share on other sites
I'll have a look at this!

However, I'm afraid that, since it's still a Window, it must have the focus. And that would cause trouble, since I'd like to be able to do anything (like chatting, programmin, or whatever) with this still visible ABOVE anything else.

I'll have a look at OGL. I know it's not meant not hit the Framebuffer, but I'll try to find something anyway.

Oh, again. I have found some Java VNC server/client, so there must be a way to acces the framebuffer...

Share this post


Link to post
Share on other sites
Instead of drawing straight on the screen - just have a frameless window, grab what's under it and render that to your window and alpha blend the webcam image on top. Seems do-able to me. Also by manipulating a couple flags on window creation you can make your window always on top. Well, good luck and stuff

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