Results 1 to 3 of 3
  1. #1
    somanayr is offline Member
    Join Date
    May 2010
    Posts
    27
    Rep Power
    0

    Default Getting the applet image from an external application

    I'm trying to get the image for the applet into a java.awt.image.BufferedImage for analysis. My current solution, which does not seem to work, is to create a blank BufferedImage, get it's graphics, call the applet's paint method with the BufferedImage's graphics. Then (this is where it falls apart, I think), I use the getRGB(int x, int y) method in the BufferedImage and convert that to a color an analyze it. The *problem* is that I'm getting a whole bunch of exceptions... I think they were NullPointerExceptions?

    And if it helps, I'm loading the applet in the Runedev client, http://www.runedev.info/. The applet is RuneScape, RuneScape - MMORPG - The No.1 Free Online Multiplayer Game

    Thanks in advance!

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,172
    Rep Power
    20

    Default

    Without seeing the exception and the code where it is called from all we can say is the code is calling a method on an object that is null.

  3. #3
    somanayr is offline Member
    Join Date
    May 2010
    Posts
    27
    Rep Power
    0

    Default

    Quote Originally Posted by Tolls View Post
    Without seeing the exception and the code where it is called from all we can say is the code is calling a method on an object that is null.
    I don't have the code ATM or the exception (which is why I didn't post them). I will do another test on a different applet to see if that will work.


    EDIT:
    To be honest, the code isn't really that detailed... it's basically
    Declare buffered image
    get the BI's graphipcs
    get the applet
    applet.paint(BI's graphics);
    Color c = new Color(BI.getRGB(mouseX, mouseY));
    output c
    Last edited by somanayr; 10-14-2010 at 02:37 AM.

Similar Threads

  1. Reading external text files from an Applet
    By Arnold in forum New To Java
    Replies: 2
    Last Post: 01-07-2010, 07:43 PM
  2. Replies: 0
    Last Post: 12-03-2009, 07:46 AM
  3. Replies: 5
    Last Post: 02-20-2009, 10:18 PM
  4. Debug JAR files used in an external application
    By ragnarahk in forum Eclipse
    Replies: 0
    Last Post: 09-22-2008, 06:36 PM
  5. Image upload applet 2.0
    By jfileupload in forum Java Software
    Replies: 0
    Last Post: 03-24-2008, 05:15 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
  •