Results 1 to 4 of 4
  1. #1
    raabie is offline Member
    Join Date
    Aug 2010
    Posts
    3
    Rep Power
    0

    Default How to do a screen capture of content on web page/join 2 images

    I have a page where I am using Raphael.js to actually allow user to move a dot around the canvas which has a background image. What I am trying to do is to capture the end image of the canvas where I'll be able to see where the user placed the dot after the user clicks on a 'confirm position' button. I've thought of two methods, however I am not too sure of how to execute them.

    Method 1: Just capture the canvas as an image. Somehow this isn't possible with Javascript alone and I'm not too sure if Raphael has a built in function to allow this. I also read about exporting the svg xml file and pass it through the a library like 'Batik' however I'm not exactly sure how to do that. The tutorials I've read are really confusing.

    Method 2: To use the coordinates of the dot and overlay a dot image that I already have onto the background image and save it as an image.

    Please advice and I hope I've been clear

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,773
    Rep Power
    25

    Default

    Java has a class: Robot that can capture a screen image.
    to use it in an Applet requires giving the applet permission.

  3. #3
    raabie is offline Member
    Join Date
    Aug 2010
    Posts
    3
    Rep Power
    0

    Default

    Thks norm, however it does not allow me to dynamically capture the area I want. e.g, if the user resizes the window, it captures the screen which i do not want. Is there any way I can make it capture the pixel area based on a specific window?

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,773
    Rep Power
    25

    Default

    Is there a way to get the location and size of the window? Read the API doc for the Applet class and its parents.
    Is there a way for the Robot class to get the screen pixels for a specified rectangle on the screen? Look at the API doc for Robot.

Similar Threads

  1. Join two images
    By forumgopi in forum Java 2D
    Replies: 0
    Last Post: 05-14-2010, 06:40 AM
  2. Can't show images onto the screen
    By javaexplorer in forum AWT / Swing
    Replies: 9
    Last Post: 01-14-2010, 07:31 PM
  3. capture webcam images with java
    By MuslimCoder in forum Advanced Java
    Replies: 3
    Last Post: 12-21-2009, 04:21 PM
  4. Need Help on Remote Host Screen Capture
    By krishnaraoveera1294 in forum AWT / Swing
    Replies: 4
    Last Post: 03-13-2009, 11:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •