Current location: Hot Scripts Forums » Programming Languages » Everything Java » Getting the offscreen image from a double buffer program


Getting the offscreen image from a double buffer program

Reply
  #1 (permalink)  
Old 03-26-11, 06:51 AM
asaf660 asaf660 is offline
New Member
 
Join Date: Mar 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Getting the offscreen image from a double buffer program

Hi, I have a program which I utilize the StdDraw famous library in order to get the double buffering to run smoothly, and it does.
Like most double buffering technique, there is the BufferedImage object that represents the offscreen image which yet to be presented.
Regardless double-buffering, I've been trying to copy the offscreen image (in different time periods) so that I'll have some sort of a "screen status" or a "screen shot" to be more exact.
Then, after I have the "snap shot", to drawq that image on the offscreen image graphics component. That just doesn't work to me at any way....

Here are the functions I've made inside the StdDraw file that are supposed to make that happen, but don't succeed:

Code:
public static BufferedImage getScreen() 
{
     BufferedImage bg = offscreenImage;
     return bg; 
} 

public static void clearWithImage(BufferedImage bg) 
{
     offscreen.drawImage(bg, 0, 0, null);
     draw(); 
}
NOTE: function draw() doesn't actually drawing the image when is called on these functions.

Last edited by asaf660; 03-26-11 at 06:54 AM.
Reply With Quote
Reply

Bookmarks

Tags
doublebuffering, java, stddraw


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP & MYSQL Same Table Ishmell PHP 7 06-28-09 11:36 PM
div css theighost CSS 11 09-14-08 02:30 AM
displaying text over image ketanco CSS 10 09-11-08 07:39 PM
Image Rotation Help aliciany JavaScript 9 12-07-06 07:55 AM
problem returning interest in bankaccount program psi3000 Everything Java 6 03-27-06 01:14 PM


All times are GMT -5. The time now is 05:57 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.