Original Post
Hi, I did make some simple magnifier tool - a rectangle screen that zooms the content in it. But I got stuck at one place. I made it to capture the screen only once and added an option to refresh (recapture the screen). What I want to do is I want it to capture the screen constantly (say every 0.5 seconds), like the Windows Magnifier Tool. I guess what I have to do but I am not sure how to implement it.
That's my code so far:
http://pastebin.com/2qnBh23g
http://pastebin.com/qE5g7E24
I added a Timer to capture the screen every second:
[source lang="java"]time = new Timer(1000, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
magnifierPanel.getScreen();
}
});
time.start();[/source]
The problem here is that each time it captures the screen , it also captures the magnifier itself and it's kinda broken way to do it.
After that I tried:
[source lang="java"]time = new Timer(1000, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
setVisible(false);
magnifierPanel.getScreen();
setVisible(true);
}
});
time.start();[/source]
But in this case , the whole magnifier area (the rectangle screen in my case) is blinking, because it constantly swaps between setVisible - false and true.
I will be glad if you help me to find a solution ! Thanks
.
That's my code so far:
http://pastebin.com/2qnBh23g
http://pastebin.com/qE5g7E24
I added a Timer to capture the screen every second:
[source lang="java"]time = new Timer(1000, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
magnifierPanel.getScreen();
}
});
time.start();[/source]
The problem here is that each time it captures the screen , it also captures the magnifier itself and it's kinda broken way to do it.
After that I tried:
[source lang="java"]time = new Timer(1000, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
setVisible(false);
magnifierPanel.getScreen();
setVisible(true);
}
});
time.start();[/source]
But in this case , the whole magnifier area (the rectangle screen in my case) is blinking, because it constantly swaps between setVisible - false and true.
I will be glad if you help me to find a solution ! Thanks