Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-28-2004, 08:04 AM   PM User | #1
mex
Regular Coder

 
Join Date: Jul 2003
Location: somewhere
Posts: 134
Thanks: 0
Thanked 0 Times in 0 Posts
mex is an unknown quantity at this point
Unhappy Need help with this Java

I'm not a java programmer and so i couldn't really understand the working of this script!! Can anyone help me out and if u kindly send me the working version in .zip or whatever format to mex_young@yahoo.com , I'll be thankful. Thanx

-----------------
//**************************************
// Name: Screen Capture in JAVA
// Description:This code allows you to perform a screen capture on any OS using Java 1.3 or higher. UPDATED: now determines the screen size from the toolkit and captures the whole screen.
// By:
//
//
// Inputs:None
//
// Returns:None
//
//Assumes:None
//
//Side Effects:None
//This code is copyrighted and has limited warranties.
//Please see http://www.Planet-Source-Code.com/xq...s/ShowCode.htm
//for details.
//**************************************

import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import javax.swing.*;
import java.awt.Robot;
public class CaptureScreenFrame extends JFrame


{
BufferedImage img = null;
Robot r = null;
Toolkit ct = null;
public CaptureScreenFrame()


{
getContentPane().setLayout(null);
try {
r = new Robot();
ct = Toolkit.getDefaultToolkit();
} catch (AWTException ex) {
System.out.println(ex);
}
JButton button = new JButton("Capture");
button.setBounds(10,10,100,25);
button.addActionListener
(
new ActionListener()


{
public void actionPerformed(ActionEvent e)


{
img = r.createScreenCapture(new Rectangle(10,10,(int)ct.getScreenSize().getWidth(),(int)ct.getScreenSize().getHeight()));
repaint();
}
}
);
getContentPane().add(button);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e)


{
System.exit(0);
}
});
}
public void paint(Graphics g)


{
super.paint(g);
if (img != null)
g.drawImage(img,10,70,(int)ct.getScreenSize().getWidth(),(int)ct.getScreenSize().getHeight(),this);
}
public static void main(String argv[])


{
CaptureScreenFrame frame = new CaptureScreenFrame();
frame.setBounds(50,50,300,300);
frame.setVisible(true);
}
}


--------------------
__________________
Wonder
mex is offline   Reply With Quote
Old 08-28-2004, 08:08 AM   PM User | #2
jamescover
Regular Coder

 
Join Date: Aug 2002
Location: USA
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
jamescover is an unknown quantity at this point
Quote:
I'm not a java programmer
This is a javascript, not java, forum.


Quote:
Can anyone help me out and if u kindly send me the working version in .zip or whatever format to mex_young@yahoo.com , I'll be thankful. Thanx
I don't think you'll get many responses with that type of request...unless you're offering monetary compensation.



-james
__________________
"God so loved the world that he gave his only begotten son, so that whosoever believed in him would not perish, but have everlasting life. For God did not send his son into the world to condemn the world, but so that through him the world might be saved. "
jamescover is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:47 PM.


Advertisement
Log in to turn off these ads.