Take a full scene of screenshot resizing

Inside of a Swing application, I have a jfxPanel to create graphics. Now I want to save a screenshot of the card but always when I call < node > .snapshot (new SnapshotParameter (), null) the whole graph is getting resized (smaller). The result of the screenshot is the small stage. What can I do to prevent this?

Here is the configuration of scene (leftPanel is the jfxPanel):

Platform.runLater (new Runnable() {}

@Override

public void run() {}

Root StackPane = new StackPane();

leftPanel.setScene (new Scene (root));

}

});

And here's the code for snapshot:

String filename = mediaCacheString + File.separator + actDateString + ".jpg";

File final outFile = new File (filename);

Platform.runLater (new Runnable() {}

@Override

public void run() {}

StackPane stackPaneLeft = leftPanel.getScene () .getRoot () (StackPane);

Snapshot of WritableImage = stackPaneLeft.getChildren () .get (0) .snapshot (new SnapshotParameters(), null);

BufferedImage, bufferedImage = new BufferedImage (leftPanel.getWidth (), leftPanel.getHeight (), BufferedImage.TYPE_INT_ARGB);

saveImage (snapshot, bufferedImage, outFile);

SwingUtilities.invokeLater (new Runnable() {}

@Override

public void run() {}

Save the screenshot as a file on the server

}

});

}

});

Yes, I have. The screenshot itself is then the right size, but the stage is resized.

In the meantime, I found the solution. When an object of the scene is created without any size as parameter the default size is 500 x 400. This size does not matter unless you create a screenshot (maybe it's a bug of the screenshot method, but I'm not sure). That stage is resized to 500 x 400. To avoid this, you must recreate the scene with the right size on each resizing the jFxPanel. I don't know if there is a better way to do this, but I found nothing.

Now the labour code:

private void createScene() {}

Platform.runLater (new Runnable() {}

@Override

public void run() {}

Root StackPane = new StackPane();

Scene = new Scene (root);

scene.widthProperty () .addListener (new ChangeListener() {}

@Override

public void changed (ObservableValue ov, number t1 t) {}

value of double type = t1 (double);

Root StackPane = new StackPane();

Scene = new scene (root, value, leftPanel.getHeight ());

leftPanel.setScene (scene);

}

});

scene.heightProperty () .addListener (new ChangeListener() {}

@Override

public void changed (ObservableValue ov, number t1 t) {}

value of double type = t1 (double);

Root StackPane = new StackPane();

Scene = new scene (root, leftPanel.getWidth (), value);

leftPanel.setScene (scene);

}

});

leftPanel.setScene (scene);

}

});

Platform.runLater (new Runnable() {}

@Override

public void run() {}

Root StackPane = new StackPane();

Scene = new Scene (root);

scene.widthProperty () .addListener (new ChangeListener() {}

@Override

public void changed (ObservableValue ov, number t1 t) {}

value of double type = t1 (double);

Root StackPane = new StackPane();

Scene = new scene (root, value, rightPanel.getHeight ());

rightPanel.setScene (scene);

}

});

scene.heightProperty () .addListener (new ChangeListener() {}

@Override

public void changed (ObservableValue ov, number t1 t) {}

value of double type = t1 (double);

Root StackPane = new StackPane();

Scene = new scene (root, rightPanel.getWidth (), value);

rightPanel.setScene (scene);

}

});

rightPanel.setScene (scene);

}

});

}

Tags: Java

Similar Questions

  • Time Machine every few weeks stopped backup because it must create a new backup. 9 to on MY Cloud EX2 takes 4 full days. Crazy to keep losing all backup dates.

    Time Machine every few weeks stopped backup because it must create a new backup. 9 to on MY Cloud EX2 takes 4 full days.

    Crazy to keep losing all backup dates

    Message reads

    "Time Machine has conducted an audit of your backups on"WDMyCloudEX2". To improve the reliability,

    Time Machine must create a new backup for you"

    Click Start a new backup to create a new backup. This will remove your existing backup history. This may take several hours.

    Click Back Up later to be reminded tomorrow. Time Machine won't perform backups during this period.

    Is - this common, no way to stop it?

    Just take a brief look at WD for 'My Cloud EX2' site, they list El Capitan as an operating system supported. Mavericks is the latest OS listed. Probably you need to contact Western Digital support.

  • in most programs, F11 will take you full screen.  in adobe reader, you must use Ctrl-L.   F11 can be added to adobe reader as a shortcut for mode full screen?

    in most programs, F11 will take you full screen. in adobe reader, you must use Ctrl-L. F11 can be added to adobe reader as a shortcut for mode full screen?

    Hi hanekam123,

    I'm sorry, that is not possible, that is how Acrobat/Reader is built. For drive mode, you can use Ctrl + L to fullscreen or Ctrl + H.

    Kind regards
    Nicos

  • Take a full screenshot?

    I tried the print screen method etc. windows button and only got part of my screen. How can I get a complete screenpic?

    The addon tools all take only shots of the webpage, not the entire screen.
    

    See:

  • Mouse track records do not full scene?

    I have trouble getting a mouse trail to record data on the length of my scene.

    In my scene, I am animating the students with a track of mouse because I'm not happy with the results of monitoring I get. When I record in the scene, even if I record in 200, it returns only the data up to the 45 of the kind frame.

    Just to test, I created a fresh PSD that only had the mouse inside layer, it imported as a separate and tried recording puppet who. It also returns not the full of my recording, although this time frame 100. Is there a limit to how long I can record depending on the size of the PSD, or any other factor?

    I'm on a fast enough machine, an 8 core xeon 3 GHz current gen Mac Pro with 32 GB of ram, under 10.10.4, with a lot of space on my ssd.

    Hi hunt them... Ah, Yes, we require a microphone / audio and webcam at the moment. We have an internal bug on this issue. It generally does not create just any bar to take (at least in my tests on Windows), so it is interesting to take bar was created.

    I'll be referring to this thread of discussion in our internal bug. If you can use the webcam/mic for now, it would be better (of course). We will investigate documents of record in this type of configuration.

    Thank you.

  • Someone knows how to take a normal jpg picture and resize to fill entirely the PRE/wallpaper...

    I have a beautiful hi-res jpg photo of my children, I would like to make the wallpaper on my pre, unfortunately he fills all the screen. Does anyone know what size/screen resolution must be converted in order to complete fill the bottom of pre...

    Screen resolution is 320 x 480.  Instructions for saving the photos as wallpaper can be found on page 110, User Guide.

    WyreNut

  • Receptive - group elements resize and reposition in the center of the scene

    Hi just want to ask again on reactive animated projects.

    I wanted to do a sensitive hero slider and I want a group of items on the scale and reposition as resize the window. Is this possible? No matter how I try some of the elements don't resize or not nudge to the center of the stage. Please take a look at the screenshots below.

    a.PNG

    Then, when the window is resized, the elements grouped not correctly resize or glue to the Center.

    b.PNG

    Please, any help would be much appreciated I paint a white on what other methods to do so.

    Yes its really sad its research to this entire edge platform adobe is stop down or something... There are no moderators on the forum of reflow and your question went completely answered and forced to go a different route... They are turning users away by the lack of support on these forums... Why even come with new software and we get excited if you're just not going to support it and just care about photoshop... Bad bad adobe form form... Ugh so crazy...

  • How can I stop other sites resizing FireFox (switch to full screen)?

    Can I configure FireFox to stay in my default size. A chat site, sure I'll change Firefox in full screen but also resize a much smaller second screen. I put FireFox not open a new window, but a new tab.

    website: uk.worldsbiggestchat.com

    Need help please, this is the case, boring!
    Kind regards
    Archie

    See:

  • Full screen video mode, preserving the size of objects

    Hello

    My task is to show a video player using the full screen. I have no problem doing that, but I need to perform in such a way that only video scales to full screen while other objects (the player controls) remain unadjusted. If I just go full screen - mode everything onstage is furred naturally.

    Playing with the functions of full screen I could come up with the only solution that is to calculate a scale factor (based on, say, stage.width and stageWidth) and adjust the dimensions of the player controls and position accordingly.

    Is the best way to preserve the sizes of objects or there is a better technique?

    I was hoping that each display object has it's own scene and I could show only video fullscreen by doing something like:

    _video.stage.fullScreenSourceRect = screenRectangle;
    _video.stage.displayState = StageDisplayState.FULL_SCREEN;

    but he's still developing all objects.

    Thanks much for sharing you experience (or sources).

    Hello

    I must apologize for my stupidity in the post in 2008-06-19 12:08:40 (as well as other incidents of my brain dysfunction). I made statements that are not true. For example, I said: "their assumption was that video is the King, and by default to go fullscreen is to resize the video only." It's BS. They don't make this assumption and, in fact, programmers have complete control over the display.

    kglad, you inspired me to look deeper into the hardware acceleration and now I understand better things (or so I hope).

    I do deviate acceleration hardware and all resizing occurs by program.

    My understanding is that when using the Rectangle across the video - he dimensionnera everything that is within the limits of the rectangle. I couldn't find a way to scale just a video using the rectangle. I was hoping that working a line as follows:

    _video.stage.fullScreenSourceRect = screenRectangle;
    _video.stage.displayState = StageDisplayState.FULL_SCREEN;

    He did but in the same way that (note there no _video in scope)

    stage.fullScreenSourceRect = screenRectangle;
    stage.displayState = StageDisplayState.FULL_SCREEN; -which means that everything is scaled up.

    I don't think I fully understand the concept of stage again because in my mind that each object display had it's own step and this step translates the scene of a higher display object (parent). Actually, when I speak of stage - it takes the reference to the highest stage.

    kglad, if you find the time to clarify this point - it would be a huge contribution to humanity :-)

    Back to the description of how I coded full screen WITHOUT using hardware acceleration (in case someone still hope my intellect :-):)

    Step 1. A mechanism that responds to the wish of the user to see the screen full of thing.

    It could be a button with a listener added. The listener will change stage.displayState

    Step 2. Create a mechanism which reacts to changes in displayState.

    a. get System.Capabilities.screenResolutionX and screenResolutionY - these two parameters will tell you how wide and high video possible.

    b. calculate desired video dimensions based on the height and width of resolution and video metadata. This means that one of the ratios will give you scale factor. For example:

    var scaleFactor:Number = Capabilities.screenResolutionY/metaData.info.height will define how it increased (by definition _video.scaleY and scaleX = scaleFactor) using this scale factor newly calculated (assuming you want all the video screen filling).

    c. balance video. Center it if you wish.

    d. hide the objects you want to be shown in the view full screen

    e. visible positions of objects in a desired way. For example, move the player to the bottom of the screen controls calculate x and y, once again, by using parameters screenResolution.

    When the user leaves the mode full screen - reverse what has been done: resize the video at its original size, the positions of origin x and y, see other items, move the Player control to which they belong.

    Fact.

    A brief look at the approach is to enter full screen mode without resize the SWF to the origin. If no further action taken - your player look as it seems at the origin: all the preserved dimensions and swf is the position where there is default (left, Center, or right). And then resize/reposition specifications.

    It will be useful.

    Thanks kglad!

  • Background Image/Video - full scale &amp; centered

    Trying to figure out how to animate a centered background reduced onboard image/video.  Can't code, so I am using the Properties panels, but I'm a bit confused. I want to

    1. have the image centered in the middle of the scene

    2. do evolve to fill the screen always, so there is no black bars (IE, I want a step with only a photo to this topic)

    http://whakarongo.com/stage/index.html

    (This project is intended only for iPad and more - desktop computer, don't need mobile resolutions)

    My work around is to do it via manual CSS, but there must be a better way to keep within the compositiion of edge

    I also tried to import this edge in redesign stage or after seeing this demo http://www.YouTube.com/watch?v=bK2lhP7oyFQ

    but I just blank screens: http://whakarongo.com/stage2/index_preview.html

    (I love not ability to reflow to specific resolutions target but I absolutely need it for this project)

    If someone did or is code warned, would appreciate your kind assistance.

    made a model for a fullscreen html5 video

    his is alwase full screen even when resizing to mobile format.

    https://app.box.com/s/r6dg3cj1xd8kpjkurap9

    Have fun.

    -Rob

    BTW, if it helped you to put this post as correct anwser

  • Is this a bug? Resizing of content with an opacity box problems.

    I was wondering if this is a bug? I tried to get a box behind a text box to resize according to the amount of content that is located in an area of text above it. It works fine when the box located below the text box is set to 100% opacity. However when I adjust the box below for less than 100% opacity stop box resize with the text box. My questions are is this a bug or intended, and if it's a bug is there a workaround or will be fixed soon?

    Hello

    Thank you for bringing this place. We were able to reproduce the problem, and it was recorded as a Bug.

    It seems to be a problem when opacity is reduced in the toolbar at the top.

    However, to work around the problem, I would suggest you use the opacity under the filler panel option.

    To do this, you will need to select the rectangle in the background, and then click filler panel that appears on the right side. And you can change the opacity of there value.

    Please take a look at the screenshot below that might help:

    When the opacity value is passed to this filler panel, the property of the rectangle to resize with text is preserved.

    We recorded a bug for the issue and I hope that it will be fixed in future versions of Adobe Muse.

    My apologies for the inconvenience.

    Kind regards

    Sachin

  • Since win 10, each mouse and keyboard in FF takes 2 sec. to take effect.

    Since installing Windows 10, she takes a full second or two for a ScrollBar move (for example) is taken into account. I'll turn the scroll wheel, and it will take 2 or 3 seconds for the page in fact movement. Same thing waiting for a neutral cursor to turn into a helping hand 'on-line'. In fact, I'm writing this through Chrome, because FF has become so slow and frustrating.

    What is your computer system and Firefox?

    Start Firefox in Safe Mode {web link} by holding down the < shift >
    (Mac options)
    key and then from Firefox. Is always the problem?

    Start your computer in safe mode with network. Then launch Firefox.
    Try the sites secure web. Is always the problem?

    Start the computer in Mode safe;
    Free online encyclopedia

  • Add a film scene (green screen)

    I'm looking to take a movie scene and add that someone entered on a green screen in the movie scene.

    Here is an example that I found on Youtube: https://www.youtube.com/watch?v=M1zdROf6EjU.

    I continue to find a way for Adobe, but nothing for Final Cut Pro X. Someone at - there a way to do this?

    Put clip of green screen on top of the background clip in the timeline panel.

    Drag the "Overlay" Keyer in the effects palette and drop it on the green screen clip.

    Job done.  .  .  Although sometimes you may have to tweak it to perfection.

  • Photos and screenshots

    Since the update of my iPhone, I was unable to take photo or screenshot. Is this a known issue and that affect everyone? Looking for a solution, or when an update on what comes out?

    No I don't have a question on my ipad or iphone on 9.2.

    I can take pictures and do the screenshot.

    Basic troubleshooting steps:

    Reboot, reset, restore from a backup or restore as new.

  • How to take an incremental backup in windows server 2008R2 64 bit

    Dear helpdesk,

    I am unable to take an incremental backup in windows server 2008r2. Whenever he takes the full backup.

    Help, please.

    Post in the Windows Server Forums:
    http://social.technet.Microsoft.com/forums/en-us/category/WindowsServer/

Maybe you are looking for

  • Two-factor monitoring iPhone

    Hey. Let´s say that my iPhone would be stolen and I have two-factor authentication, the thief will not be able to see the request of "log - inn? How does grace to find my iPhone?

  • Satellite Pro P300 just died on me

    Hello Yesterday my Satellite Pro P300 (PSPC1E) died just the'm... no battery charging lights nothing. Nothing happens when I press the power button it is DEAD.The battery was ok last time used, the adapter is still give me almost 20volts. I took the

  • Help me find a driver for hp dv6-7260er on win7 prof envy

    formerly 8 victory, was now win7 prof Fast analog computer with win 7 Thank you.

  • Craig the unauthorized contact list

    I have listed a car on Craigs list and received an email inquire about the car. The email should have through the craigs list. It came to my personal email address. Like a dummy I don't think and responded to the person to their email. I have filtere

  • A pop-up screen that will be unveiled later closing

    Here's the basic idea. I have Ecranun, where the user can select a button... After the selection, ScreenB (a popup) is pushed, where the user chooses between suboptions. After choosing, they return to Ecranun. If they choose another screenB button sh