Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #26868
| From | Jeff Higgins <jeff@invalid.invalid> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Basic 2d graphics in Java |
| Date | 2013-12-12 17:42 -0500 |
| Organization | A noiseless patient Spider |
| Message-ID | <l8de66$2ei$1@dont-email.me> (permalink) |
| References | <527c86f0-1b3d-4103-bd42-a5dcd9ade567@googlegroups.com> |
On 12/12/2013 11:45 AM, tomcees_pc@yahoo.com wrote:
> Hello:
>
> I'm working through re-learning java and would like to solicit some help.
>
> Can anyone share some simple java code to:
>
> 1. Set up a small (say 320w x 240h) 2d window.
> 2. Set(color) and Read (color) of pixels within this window.
>
> TIA for your help,
> TomC
>
Just cause so many are heaping on Swing lately.
package pixel.test;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.image.ImageView;
import javafx.scene.image.PixelReader;
import javafx.scene.image.PixelWriter;
import javafx.scene.image.WritableImage;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class PixelTest extends Application {
WritableImage image = new WritableImage(320,240);
PixelReader pixelReader = image.getPixelReader();
PixelWriter pixelWriter = image.getPixelWriter();
//setPixel and readPixel left as an exercise
@Override
public void start(Stage primaryStage) {
ImageView imageView = new ImageView();
imageView.setImage(image);
StackPane root = new StackPane();
root.getChildren().add(imageView);
Scene scene = new Scene(root, 320, 240);
primaryStage.setTitle("Pixel Test");
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread
Basic 2d graphics in Java tomcees_pc@yahoo.com - 2013-12-12 08:45 -0800
Re: Basic 2d graphics in Java markspace <markspace@nospam.nospam> - 2013-12-12 09:39 -0800
Re: Basic 2d graphics in Java lipska the kat <"lipskathekat at yahoo dot co dot uk"> - 2013-12-12 19:07 +0000
Re: Basic 2d graphics in Java Joerg Meier <joergmmeier@arcor.de> - 2013-12-12 20:43 +0100
Re: Basic 2d graphics in Java lipska the kat <"lipskathekat at yahoo dot co dot uk"> - 2013-12-12 19:47 +0000
Re: Basic 2d graphics in Java lipska the kat <"lipskathekat at yahoo dot co dot uk"> - 2013-12-12 20:14 +0000
Re: Basic 2d graphics in Java tomcees_pc@yahoo.com - 2013-12-12 12:37 -0800
Re: Basic 2d graphics in Java Jeff Higgins <jeff@invalid.invalid> - 2013-12-12 17:42 -0500
csiph-web