-
April 24th, 2017, 12:19 PM
#1
JavaFx Image size
Hello
I am deveoping my own image view/handling program. But I am having issues with how my image takes the size my monitor.
It is a JPG file - a image I took with my iphone. In my code when load and save it in a JavaFX image and I print out the size it say the size of my monitor. Why do the image size change - how do I get the actual image size?
The image has no (0) "requestedWidth" or "requestedHeight".
I do: Image image = new Image(Main.class.getClassLoader().getResource("Image.JPG").toString());
Java fx ImageView imageView = new ImageView();
imageView.setImage(image)
Then I put imageView in a StackPane layout, put it in a Scene and then in primaryStage. (Then the image cover all my monitor size).
When I open the image in windows Photo Viewer it has the correct size. In Paint I get the right size when I zoom out fully. As an image in javafx it takes the size of my monitor. Why?
-
April 25th, 2017, 05:46 AM
#2
Re: JavaFx Image size
Originally Posted by Lealo
Hello
I am deveoping my own image view/handling program. But I am having issues with how my image takes the size my monitor.
It is a JPG file - a image I took with my iphone. In my code when load and save it in a JavaFX image and I print out the size it say the size of my monitor. Why do the image size change - how do I get the actual image size?
The image has no (0) "requestedWidth" or "requestedHeight".
I do: Image image = new Image(Main.class.getClassLoader().getResource("Image.JPG").toString());
Java fx ImageView imageView = new ImageView();
imageView.setImage(image)
Then I put imageView in a StackPane layout, put it in a Scene and then in primaryStage. (Then the image cover all my monitor size).
When I open the image in windows Photo Viewer it has the correct size. In Paint I get the right size when I zoom out fully. As an image in javafx it takes the size of my monitor. Why?
I solved it. I mistakenly thought the image pixels where the same as my monitor size.The image was in fact to large to be displayed on my monitor (through javafx).
(This thread can be deleted or be left here if someone else would make the same mistake as I did)
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|