Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

Screen Scrap an Applet

Thread view: 
John A. Bailo - 10 Jan 2006 16:15 GMT
Know any references for how to screen scape an applet?

Signature

RSS Feed/Incognito Blog
http://blog.360.yahoo.com/rss-siXzkMA8eqhXNgGa9ZbTlKkOL5SWLA--

IchBin - 10 Jan 2006 17:12 GMT
> Know any references for how to screen scape an applet?

public class ScreenShot
{
    public static void main(String[] args)
    {
        try
        {
            // Get the screen size
            Dimension screenSize =
Toolkit.getDefaultToolkit().getScreenSize();
            Rectangle rectangle = new Rectangle(0, 0, screenSize.width,
                    screenSize.height);
            Robot robot = new Robot();
            BufferedImage image = robot.createScreenCapture(rectangle);
            File file;

            // Save the screenshot as a png
            file = new File("screen.png");
            ImageIO.write(image, "png", file);

        } catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
}

Signature

Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor,  Regular Guy (1952-)

Thomas Hawtin - 10 Jan 2006 18:21 GMT
>> Know any references for how to screen scape an applet?
>
> [...]
>             BufferedImage image = robot.createScreenCapture(rectangle);
> [...]

I think you'd be better off supplying a custom Graphics object rather
than trying to do character recognition.

Tom Hawtin
Signature

Unemployed English Java programmer
http://jroller.com/page/tackline/

IchBin - 10 Jan 2006 23:21 GMT
>>> Know any references for how to screen scape an applet?
>>
[quoted text clipped - 6 lines]
>
> Tom Hawtin

Sorry Tom, why is that.. using the robot.createScreenCapture() has
worked for me. What are some of the implications for doing it this way.
What would be an example for coding a graphics object or just point me
into the right direction, I'd be interested.

Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor,  Regular Guy (1952-)
Thomas Hawtin - 11 Jan 2006 16:15 GMT
>>>> Know any references for how to screen scape an applet?
>>>
[quoted text clipped - 9 lines]
> What would be an example for coding a graphics object or just point me
> into the right direction, I'd be interested.

Using Robot is fine if you have a dedicated machine, and are interested
in bitmaps rather than text and vector graphics.

To get the raw text, for instance, get the applet to paint itself to one
of your Graphics (or Graphics2D) objects. In the implementation of
Graphics.drawString, capture the text and do with it what you will.
Obviously, there is a degree of set up required to run the applet
outside of a conventional applet viewer.

Tom Hawtin
Signature

Unemployed English Java programmer
http://jroller.com/page/tackline/

IchBin - 11 Jan 2006 19:16 GMT
>>>>> Know any references for how to screen scape an applet?
>>>>
[quoted text clipped - 20 lines]
>
> Tom Hawtin

Thanks Tom for the info..

Signature

Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________

'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor,  Regular Guy (1952-)



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.