Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (526)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (593)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Can I draw on the desktop?  (Read 1694 times)
0 Members and 1 Guest are viewing this topic.
Offline tonberry1

Junior Devvie





« Posted 2006-12-27 18:21:01 »

Hi.

I'd like to be able to draw lines and images on top of other applications or on top of my shortcuts on the desktop.

I have investigated this for a while now, and I know it can be done with C++, and you could do something like that with .NET-languages (atleast to make the background invisible). But I still would like to do it in Java, if possible, as I know it the best.

So. Any ideas, is this possible? You can go into fullscreen mode with Java, but is it possible to show the usual desktop with other programs instead of the black fullscreen background (like invisible fullscreen Smiley)?

-= Life is what you decide it to be - Solid Snake =-
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 833
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #1 - Posted 2006-12-27 18:30:33 »

No, you can't in Java.

You can fake it by taking a screenshot and drawing on top of it, but that will catch all mouse events too, so the applications below it won't respond to anything.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline tonberry1

Junior Devvie





« Reply #2 - Posted 2006-12-27 19:50:42 »

Actually I don't need to interact with the other applications. That screenshot might be enough, if I had the program running in a small window or in the systray.

But after the screenshot, I think I'd need to maximize the window to be able to draw on top of it. And after a little while, I might have to minimize/restore it and pop it up again.

Or is there a way to take screenshots behind the Java application?

-= Life is what you decide it to be - Solid Snake =-
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline woogley
« Reply #3 - Posted 2006-12-27 20:38:15 »

you'd have to take the screenshot before your window is visible.

check out Robot.screateScreenCapture

after you get the image, switch to fullscreen mode, draw your captured image, and then do whatever you want.
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 833
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #4 - Posted 2006-12-27 21:14:39 »

It will be flickering though, upon creating the window Undecided

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 78
Projects: 15


★★★★★


« Reply #5 - Posted 2006-12-27 21:16:46 »

technically might be possible by using native code by creating a special type of canvas/frame, but not sure how easy it would be do implement, would have to be some sort of transparent overlay that allows clicks through and can draw at the same time.
Offline tonberry1

Junior Devvie





« Reply #6 - Posted 2006-12-28 22:40:32 »

I just tested the fullscreen trick. Well, it doesn't work as it takes like almost 2 seconds to enter and exit the full screen mode.

But I guess I can try to do it with some other language then. Just wanted to confirm that there isn't an easy way with Java Smiley

Thanks anyway.

-= Life is what you decide it to be - Solid Snake =-
Offline fletchergames

Senior Devvie





« Reply #7 - Posted 2006-12-29 16:26:21 »

It always takes almost 2 seconds to enter full-screen mode.  That's why Java 6 includes the ability to add a splash screen.
Offline tonberry1

Junior Devvie





« Reply #8 - Posted 2006-12-29 20:52:48 »

It always takes almost 2 seconds to enter full-screen mode.  That's why Java 6 includes the ability to add a splash screen.
True. I actually even tried that SplashScreen as I havent used it before, but it looks like you can't draw on it (other than images) without pretty special magic tricks. And on top of that, you can't change the position.

-= Life is what you decide it to be - Solid Snake =-
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

toopeicgaming1999 (72 views)
2014-11-26 15:22:04

toopeicgaming1999 (62 views)
2014-11-26 15:20:36

toopeicgaming1999 (15 views)
2014-11-26 15:20:08

SHC (29 views)
2014-11-25 12:00:59

SHC (27 views)
2014-11-25 11:53:45

Norakomi (32 views)
2014-11-25 11:26:43

Gibbo3771 (27 views)
2014-11-24 19:59:16

trollwarrior1 (40 views)
2014-11-22 12:13:56

xFryIx (78 views)
2014-11-13 12:34:49

digdugdiggy (56 views)
2014-11-12 21:11:50
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!