Display BMP Files Without A Frame - java

I want to devlop simple image application in java. I need to display the image without anything around it. That is, there should be absolutely no application frame or title bar or anything else. When I open the image in this application, all I will see is the image floating on my screen.
In should when my application shold work like google picasa(desktop version).
When i install picasa and double clikc on image it shows me the full scrin image without any application window.

Or you could set the frame to be undecorated.
frame.setUndecorated(true);
It will look and behave just as a Window container.

Use java.awt.Window or javax.swing.JWindow?

It doesn't sound like you need a window at all. A SplashScreen should do what you want, provided that you don't need the user to interact with the image in any way other than viewing it. You can look at the SplashDemo.java file from the link above to get started.

Related

Screenshot of frame on the webpage

I was just wondering how to take a screenshot of my webpage. Lets say i have an interface around all borders, and in the middle is the frame that shows websites. How would it be possible to take a screenshot of that frame. I would not need any borders and interface included in that snap. Only the frame, how can it be accomplished?
I have included the picture which represents the layout of a website, so no need to include the entire layout but just this segment in the frame. How to capture that frame in an image programmatically? What tools and programming language can do this for me?
PhantomJS is a fully programmable headless browser. It is able to produce PNG, JPEG, GIF and PDF files from the web pages it opens.
Use document.querySelector(), then element.getBoundingClientRect() DOM APIs to get the rectangle containing the element you want to rasterize, then set webpage.clipRect property to it and call webpage.render() method to produce the image. See this answer for an example.
I do not know if you really have no limitations on the technology you wish to use, but phantomJS (headless browser) can certainly be use here. Example: How to render part of a page with PhantomJS

Draw a window only on top of an external application in Java

I am trying to create a JWindow that sits on top of an external application.
I want the window to resize whenever the external application resizes (to match it) and be only on top of the external application and not everything else. (I can't use setAlwaysOnTop(), because it would be always on top of everything).
By modifying code from the first answer from here I am able to find the external window title (for example Untitled - Notepad) and its handle if needed.
Using code from the first answer from here, I can get the dimensions of an external window from it's window title.
The problem with finding the dimensions from the code at the second link is that I have to always loop and check them (which is not optimal) and it isn't helpful in putting my window only on top of the external one.
Is there a way to implement what I want in Java? Ideally, I would (using JNA?) make a listener to the messages (WinEvents?) the OS sends to the external program to resize it, gain/lose focus etc and handle them somehow.

Java Swing Background image repeat and maximized window

I want to make my application header repeated image like similar to ccleaner application header , below. I want to also put logo right top corner but when I maximizing the window , it stays in the middle. I am currently using netbeans.
Similar to ;
CSS Background Repeat ,
Okay, well do you have an attempt within your netbeans project? Something visual like a screen shot of your running application that we can work with.
If you have set your panel to the size of the JFrame then you have two options.
1. Lock the JFrame from resizing at all: Prevent Window resizing on Java (Netbeans)
2. Make the application scale/resize with the JFrame: JFrame Resizing in Desktop Application - NetBeans
Let me know if those help.
A lot of Netbeans (in terms of sizing/responsiveness) is about setting the Frame/Panel/ect... attributes so that they are all the same (locked or re-size'able)

How to make overlay for video in swing

I want to make a transparent overlay for a foreign project to show live video. Sample of overlay is given in the image link below. In image you can see a overlay at right bottom corner showing face of a person, I also want to achieve same functionality using JMF to show face and then display the face in overlay using swing.
Sample Overley Imahe: http://www.ovostudios.com/images/vidsamsolo.jpg
Can someone help achieving this functionality?
If you're just starting the project and haven't actually got the JMF part up and running yet, then you might want to take a look at some alternatives before committing to it.
If you want to go ahead with Swing, to get the general overlay behaviour you want, you'll need to make use of Frame.setUndecorated() to turn off window borders and buttons, and Window.setAlwaysOnTop() to make sure the window stays on top of other windows. For the transparency, see this tutorial. However, I'm not sure whether transparency and video will work nicely together, so good luck!
You might also want to write a custom focus handler for the window so that it cannot be focused, although it is probably impossible for the overlay to be properly 'phantom' whereby clicks just pass through the overlay to the underlying desktop. That kind of behaviour might only be possible by using low-level graphics techniques i.e. by not creating a window at all, but by drawing directly onto the screen. That might require a native library.

Pasting a Screen shot into a text area on a web page

Is it possible to take a screen shot (using the Print Screen) and paste it from the System Clipboard directly into a web pages text area field (which I would create)? Do I need a browser plug-in? Can Flash do this?
**The solution only has to work in Internet Explorer.
This is not possible without a plugin.
It's not possible in Flash or Silverlight either, although it is possible in AIR.
I think you will have to write a custom ActiveX Control in order to do this. The control should automatically take a screenshot and send captured image to server-side code..
There is one more option - create a java applet, which will do the job, and also will help you to avoid cross browser issue.

Categories

Resources