PDA

View Full Version : How would I create a buffered image of my applet?



chandlerethan
01-07-2012, 07:59 PM
Ok so I'm trying to figure out how to take a virtual screenshot of my RS Loader (applet) so that I can see the image, even when it's minimized (like S.M.A.R.T. does) but I'm coming up empty-handed on ideas. Any suggestions from more advanced programmers?

ShawnjohnSJ
01-07-2012, 08:05 PM
I can't help you with this because I've never had to work with taking screenshots, but I just want to say that I don't think its possible to take a picture of the applet while its minimized in pure java, you might have to use JNI.. someone correct me if I'm wrong.

Richard
01-09-2012, 01:09 AM
I can't help you with this because I've never had to work with taking screenshots, but I just want to say that I don't think its possible to take a picture of the applet while its minimized in pure java, you might have to use JNI.. someone correct me if I'm wrong.

I don't think that's entirely true. I've been looking through the source of RSBot, and there was a method to capture a screenshot, so I know it's not impossible. I don't know if it would be awfully efficient though, when you think about the number of pixels being handled to make the image, then any methods to cycle through all the pixels. I had the idea of images in different areas (MS, MM, INV, Chat), so it would be dealing with far less data. If you'd like to look into how RSBot dealt with it, I've got the source for the screenshot utility here (https://github.com/Ineedajob/RSBot/blob/master/src/org/rsbot/util/ScreenshotUtil.java), you can cycle through the rest of repository to find any other bits that you might find useful.

ShawnjohnSJ
01-09-2012, 01:22 AM
I don't think that's entirely true. I've been looking through the source of RSBot, and there was a method to capture a screenshot, so I know it's not impossible. I don't know if it would be awfully efficient though, when you think about the number of pixels being handled to make the image, then any methods to cycle through all the pixels. I had the idea of images in different areas (MS, MM, INV, Chat), so it would be dealing with far less data. If you'd like to look into how RSBot dealt with it, I've got the source for the screenshot utility here (https://github.com/Ineedajob/RSBot/blob/master/src/org/rsbot/util/ScreenshotUtil.java), you can cycle through the rest of repository to find any other bits that you might find useful.

Thanks for correcting me. Good to know its possible.

Richard
01-09-2012, 01:29 AM
Thanks for correcting me. Good to know its possible.

I haven't proven you wrong just yet :p I've yet to actually figure out how to do so...

ShawnjohnSJ
01-09-2012, 01:44 AM
Well, RSBot takes screenshots while minimized right? If so that pretty much proves me wrong. :P

dwimage
06-07-2013, 02:50 AM
don't know about that, but you may be wrong