Re: How to convert GUI component's graphics to int[]or byte[]?



Aki Laukkanen wrote:

Has anyone ran into the problem of trying to get a GUI component's graphics converted into an array of ints (or, even better, bytes)?

Yep. I did a 'screenshot' task for the SaverBeans (Java screensavers) project recently.

I've tried doing this by having the component paint() its graphics on a java.awt.image.BufferedImage and then using a java.awt.image.PixelGrabber' s getPixels() to extract the array.

I was first thinking along those lines, but I Googled the group and noticed the answers for getting an image of a Java (or any) component, kept being 'Robot.createScreenCapture()'.

For an example, see the version 0.1 source example at this page,
<https://screensavers.dev.java.net/issues/show_bug.cgi?id=13>
though there are also links near the top of the page to the 0.2
version in a zip file.

HTH
.



Relevant Pages

  • Re: [PHP] Dynamic dropdown lists (select)
    ... First, if I got this correct, you can extract the makes select-element from ... The next thing is writing down a js code, that contains an array of models ... Im thinking maybe AJAX ... im not a fan of this technique on full-blown web browsers, ...
    (php.general)
  • Copying an array slice (Was: Re: Difficulties with passing multi-dimensional arrays)
    ... to extract an arbitrary-size slice from an arbitrary-size 2D array and I ... perhaps compiler optimisations would remove that seeming benefit - I know ...
    (comp.lang.c)
  • Newbie: Array of pointers to strings questions.
    ... What I'm trying to do is extract information from one file and insert ... and the information in each case is extracted as a string. ... the relevant file is read into a temp file, ... but handling the array was a problem. ...
    (comp.lang.c)
  • Re: [PHP] Dynamic dropdown lists (select)
    ... First, if I got this correct, you can extract the makes select-element ... The next thing is writing down a js code, that contains an array of models ... Personally, I'd use a 2 dimension array, the first dimension ... for the make id/name and the second for the model id/name. ...
    (php.general)
  • Re: Define an array
    ... The goal was to extract ALL unique values from a multi-row ... multi-column range. ... figure out how to create/pass the linear array to the ... >Charles' formula looked to me to be terribly inefficient - ...
    (microsoft.public.excel.worksheet.functions)