Omnimaga
General Discussion => Technology and Development => Computer Projects and Ideas => Topic started by: nxtboy III on March 15, 2012, 06:36:03 pm
-
Hi,
Could someone make a program for me that displays the screen and 2 times before, all in 33% opacity? It would refresh every *blank*(You can choose) milliseconds. That way I could have stuff for my NXT look grayscale.
Would it really be that hard? Could somebody?
Thanks, and have a nice day,
nxtboy III
-
So, would this be hard to make? It would help me...
-
I've no clue how to approach this :/ Does the NXT natively support grayscale? If not, how easy is it to do bitwise logic?
-
No, the NXT does not natively support grayscale, just like the TI 84. What's bitwise logic?
Also I was talking about a computer program to do this, so I could use a utility that captures my NXT's screen (It captures it in monochrome). When I said "screen", I was talking about the computer screen, not the NXT's.
-
Ah, okay. No, I wouldn't even know where to begin, sorry.
-
Yeah...
I would need someone who can program computers.
-
I can program both the nxt and the computer. No, grayscale shouldn't work on the nxt. It's not really made for games like that. What are you programming the nxt with?
Might I suggest, if you want to use it as a controller, to use the usb routines from lejos, and write a computer program that emulates itself as a virtual key-board. You can configure the buttons on the nxt to respond to certain key-presses.
My main question, though, is why you want to do this.
-
???
I already have made grayscale games on the NXT. Check in my sig, After Dark. It's a grayscale NXT game. I wanted a computer program to show the computer screen 3 times (current frame and a certain time before (twice) ) at 33% opacity.
-
Basically a NXT emulator for Windows? (with Axe/83+ASM grayscale style scanlines?)
-
That would be better, (It would be AWESOME) but I was just asking for a program to display the computer screen 3 times (current frame, and frame at a certain time before(Then again))at 33% opacity.
-
So this is what I want the program to do with the 3 pictures:
-
To completely capture the whole screen sans-ss and then combine it with other ss, and then redisplay the combined ss fullscreen would take some sort of native hacks I feel like. This was the closest i could get in java i think, good enough?
-
Cooliojazz he meant multiple screens as in motion-blur
EDIT Actually nvm, for odd reasons the fuirst time I ran your program it ran so fast that I didn't see the motion blur.
-
To completely capture the whole screen sans-ss and then combine it with other ss, and then redisplay the combined ss fullscreen would take some sort of native hacks I feel like. This was the closest i could get in java i think, good enough?
How about it could take just a part of the screen, like you did in your .jar program, then it will save a screenshot every n milliseconds(you type in what n will be), and it will display the current screen, and 2 ones before.
-
When you display the screenshot though it wont actually be gray will it? It will be the black/white colors wont it
-
it will be gray, cuz it is showing all 3 pics at 33% opacity.
-
oh I get it now sorry
-
Ok. Could you make that program? Do you know how?
-
maybe not completely sure how to do it but I'll look into it
EDIT: How fast would you expect the NXT emulator to run(fps) without the 33% opacity?
-
Actually, its not an emulator, it just displays the screen of the NXT that is plugged into the computer. It refreshes every 50 ms.
-
Is it open source? That would make it a lot easier to do otherwise I might be able to do it but I'm not sure how well it would work.
I've only used SDL for video work but it cant capture images from other programs so I have to figure out something else to use. I think I'll use D3D9 because i found a fast way to capture the screen with it. Now if I can convert that to a SDL_Surface with set user boundaries it should work I think
-
nxtboy, did you actually try the program i wrote? it doesn't necessarily show EXACTLY 3 frames at EXACTLY 30% opacity every time, it more layers a crapload of them at closer to 40%, but it has a similar effect to what you want I think... since I don't have that emulator i obviously couldn't test the exact values to make it seem grayest...
-
cooliojazz Could I see the source for your program? I'd just like to look at it to see how you did it. Also I'm trying to learn java so I would like to just read throug some real world programs to see how to make programs
-
Sure
package screenrepeater;
import java.awt.*;
import java.awt.image.*;
import javax.swing.*;
public class ScreenRepeater extends JFrame {
Image background = null;
boolean bglock = false;
public static void main(String[] args) {
ScreenRepeater sr = new ScreenRepeater();
sr.setSize(200, 200);
sr.setAlwaysOnTop(true);
sr.setVisible(true);
sr.setDefaultCloseOperation(sr.EXIT_ON_CLOSE);
}
public ScreenRepeater() {
Thread ssUpdater = new Thread() {
public void run() {
AlphaComposite ac = AlphaComposite.getInstance(AlphaComposite.SRC, 0.2f);
while (true) {
long time = System.currentTimeMillis();
try {
background = new Robot().createScreenCapture(new Rectangle(0, 0, getWidth(), getHeight()));
temp = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_4BYTE_ABGR);
Graphics2D g2 = (Graphics2D)temp.getGraphics();
g2.setComposite(ac);
g2.drawImage(background, 0, 0, null);
setTitle((1d / (double)(System.currentTimeMillis() - time) * 1000) + "");
sleep(1);
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
};
ssUpdater.start();
Thread repainter = new Thread() {
public void run() {
while (true) {
try {
repaint();
sleep(10);
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
};
repainter.start();
}
BufferedImage temp;
@Override
public void paint(Graphics g) {
g.drawImage(temp, 4, 25, null);
}
}
Just probably don't try to learn good habits off of how I write code... =P
-
By the way Cooliojazz program would be nice if it captured a fixed regiion of the screen and the captured stuff remained in the middle. Basically some sort of window that creates a motion blur effect on the screen area where it is.
-
DJ, I was searching for a way to do something like that, but java's screen-capturing utility basically just captures the whole area including windows in your program, so to do something like that, I would have to make the program constantly minimize and un-minimize itself, or constantly toggle between full size and (0,0), or something like that every time i capture the screen, all which take far too long and/or render the program un-interactable (have fun trying to close it now... =P) So i figured just leaving it fixed in the corner would serve the purpose at least...
-
Yeah, I tried your program, but it doesn't work for what I am doing.
So could you do what I said maybe?