[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    Re: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v4]
From:       Harshitha Onkar <honkar () openjdk ! org>
Date:       2022-10-31 16:41:43
Message-ID: aY81AnJ5pagleSBS4v_6LiYH1mmCEGYrziXvjH6jtOM=.5eabf612-faff-40c5-a4c0-7ab0391b6dbd () github ! com
[Download RAW message or body]

On Wed, 5 Oct 2022 16:28:40 GMT, Alexey Ivanov <aivanov@openjdk.org> wrote:

> > > @aivanov-jdk Regarding saving the screen capture -
> > > 
> > > When JIF bounds are used, a partial image of JInternalFrame (JIF) is saved. \
> > > Hence I'm using the entire outer JFrame bounds to capture the screenshot.
> > 
> > Could be… It shouldn't. Anyway, I have no problem with capturing the entire \
> > `JFrame`. 
> > > 
> > > For the screenCapture I wanted to use **BufferedImage's getScaledInstance()** \
> > > to create the scaled version (code snippet below), but experiencing issues \
> > > while saving it. Currently I'm scaling the original image and re-drawing it \
> > > using graphics object.
> > 
> > This is definitely not what we want. It just up-scales or down-scales the current \
> > image stored in `BufferedImage`. 
> > When you run in a HiDPI environment or with `uiScale` set explicitly to a value \
> > greater than 1.0, the number of pixels is higher. `Robot.createScreenCapture` \
> > up-scales the passed in rectangle, captures all the pixels and then down-scales \
> > the captured screenshot to the user's space coordinates. 
> > At the same time, \
> > [`createMultiResolutionScreenCapture`](https://docs.oracle.com/en/java/javase/17/d \
> > ocs/api/java.desktop/java/awt/Robot.html#createScreenCapture(java.awt.Rectangle)) \
> > returns a `MultiResolutionImage` which contains two variants: (1) the base image \
> > with the user specified size, down-scaled from the screen; (2) native resolution \
> > image with the device size pixels. The second variant will preserve all the \
> > pixels seen on the screen.
> 
> > @aivanov-jdk The extra pixel seems to be added due to JInternalFrame titlebar and \
> > not from the paintBorder() code changes.
> 
> Good then. It's not from the border.

@aivanov-jdk Fix has been updated since last approval. Can you please re-review.

-------------

PR: https://git.openjdk.org/jdk/pull/10274


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic