Author Topic: Program to display computer screen 3 times before at 33% opacity- help!  (Read 9619 times)

0 Members and 1 Guest are viewing this topic.

Offline nxtboy III

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 795
  • Rating: +26/-1
  • NXT!
    • View Profile
    • Program NXT
Re: Program to display computer screen 3 times before at 33% opacity- help!
« Reply #15 on: March 27, 2012, 09:37:26 pm »
it will be gray, cuz it is showing all 3 pics at 33% opacity.

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: Program to display computer screen 3 times before at 33% opacity- help!
« Reply #16 on: March 27, 2012, 10:15:30 pm »
oh I get it now sorry
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline nxtboy III

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 795
  • Rating: +26/-1
  • NXT!
    • View Profile
    • Program NXT
Re: Program to display computer screen 3 times before at 33% opacity- help!
« Reply #17 on: March 27, 2012, 10:17:29 pm »
Ok. Could you make that program? Do you know how?

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: Program to display computer screen 3 times before at 33% opacity- help!
« Reply #18 on: March 27, 2012, 10:18:50 pm »
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?
« Last Edit: March 27, 2012, 10:25:07 pm by ruler501 »
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline nxtboy III

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 795
  • Rating: +26/-1
  • NXT!
    • View Profile
    • Program NXT
Re: Program to display computer screen 3 times before at 33% opacity- help!
« Reply #19 on: March 27, 2012, 10:28:34 pm »
Actually, its not an emulator, it just displays the screen of the NXT that is plugged into the computer. It refreshes every 50 ms.

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: Program to display computer screen 3 times before at 33% opacity- help!
« Reply #20 on: March 27, 2012, 10:52:33 pm »
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
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline cooliojazz

  • Support Staff
  • LV7 Elite (Next: 700)
  • *******
  • Posts: 619
  • Rating: +66/-9
  • I omnoms on your soul
    • View Profile
    • Unreal Phantasies
Re: Program to display computer screen 3 times before at 33% opacity- help!
« Reply #21 on: March 27, 2012, 11:22:23 pm »
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...
Spoiler For Random signess:
You can not beat my skills.
Trust me.
So don't even try.
And remember never to trust someone who says, "Trust me."

TI File Editor Progress: Remade in java like a boss. 50% we'll call it? IDK =P
Java Libraries: JIRC - 90% JTIF - 5%
TI Projects: Unreal Notator - -5000%
Nomcraft, a Bukkit mod
Some of the music I write can be found here | The Rest Should Be Here (Bandcamp)

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: Program to display computer screen 3 times before at 33% opacity- help!
« Reply #22 on: March 27, 2012, 11:26:36 pm »
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
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline cooliojazz

  • Support Staff
  • LV7 Elite (Next: 700)
  • *******
  • Posts: 619
  • Rating: +66/-9
  • I omnoms on your soul
    • View Profile
    • Unreal Phantasies
Re: Program to display computer screen 3 times before at 33% opacity- help!
« Reply #23 on: March 27, 2012, 11:34:53 pm »
Sure
Code: [Select]
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
« Last Edit: March 27, 2012, 11:35:23 pm by cooliojazz »
Spoiler For Random signess:
You can not beat my skills.
Trust me.
So don't even try.
And remember never to trust someone who says, "Trust me."

TI File Editor Progress: Remade in java like a boss. 50% we'll call it? IDK =P
Java Libraries: JIRC - 90% JTIF - 5%
TI Projects: Unreal Notator - -5000%
Nomcraft, a Bukkit mod
Some of the music I write can be found here | The Rest Should Be Here (Bandcamp)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Program to display computer screen 3 times before at 33% opacity- help!
« Reply #24 on: March 27, 2012, 11:36:12 pm »
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.

Offline cooliojazz

  • Support Staff
  • LV7 Elite (Next: 700)
  • *******
  • Posts: 619
  • Rating: +66/-9
  • I omnoms on your soul
    • View Profile
    • Unreal Phantasies
Re: Program to display computer screen 3 times before at 33% opacity- help!
« Reply #25 on: March 27, 2012, 11:41:15 pm »
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...
Spoiler For Random signess:
You can not beat my skills.
Trust me.
So don't even try.
And remember never to trust someone who says, "Trust me."

TI File Editor Progress: Remade in java like a boss. 50% we'll call it? IDK =P
Java Libraries: JIRC - 90% JTIF - 5%
TI Projects: Unreal Notator - -5000%
Nomcraft, a Bukkit mod
Some of the music I write can be found here | The Rest Should Be Here (Bandcamp)

Offline nxtboy III

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 795
  • Rating: +26/-1
  • NXT!
    • View Profile
    • Program NXT
Re: Program to display computer screen 3 times before at 33% opacity- help!
« Reply #26 on: March 28, 2012, 06:03:23 pm »
Yeah, I tried your program, but it doesn't work for what I am doing.
So could you do what I said maybe?