Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Short answer: a PNG that reports 72 ppi is not necessarily a low-resolution screenshot. In the SWT workflow used to capture the active Eclipse shell, the important quality measure is the image’s pixel width and height. The cited Stack Overflow answer says SWT saves the available pixels, while its PNG saving does not write a DPI value, so an image viewer may display a default density such as 72 ppi.

Capture the shell into an SWT Image, inspect ImageData.width and ImageData.height, and save it with ImageLoader. Do not expect a different DPI tag to create additional detail: DPI metadata describes density for display or printing; it does not increase the raster’s pixel count.

What “higher resolution” means in this SWT question

“Eclipse window” here means the Eclipse application window (an SWT Shell), not an astronomical eclipse. There are three separate properties to keep apart:

  • Pixel dimensions: the number of columns and rows in the captured raster. This is the detail you can actually inspect in the file.
  • DPI metadata: a density value associated with the image for display or printing. Changing it does not add pixels.
  • Capture scope: the example captures the active shell, so it represents that window rather than arbitrary content outside it.

The 72 ppi value reported in the question is the questioner’s observation, not a general statistic for all SWT screenshots. The answer by Stack Overflow commenter greg-449 states: “This is giving you all the available pixels. The SWT PNG save does not set the DPI in the saved file so you are just being shown a default value for the DPI.” That is why a viewer can show 72 ppi even when the raster contains all pixels available through the capture.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents

Capture the active Eclipse shell with SWT

Run capture code on SWT’s UI thread. The following complete example obtains the active shell, creates an image the size of its client area, copies the shell into that image, prints the actual dimensions, and writes a PNG.

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.graphics.ImageLoader;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public final class CaptureActiveEclipseShell {
    public static void main(String[] args) {
        Display display = Display.getDefault();
        Shell shell = display.getActiveShell();

        if (shell == null || shell.isDisposed()) {
            System.err.println("No active SWT shell was available.");
            display.dispose();
            return;
        }

        Image image = null;
        GC gc = null;
        try {
            Rectangle client = shell.getClientArea();
            if (client.width <= 0 || client.height <= 0) {
                throw new IllegalStateException("The active shell has no drawable client area.");
            }

            image = new Image(display, client.width, client.height);
            gc = new GC(shell);
            gc.copyArea(image, 0, 0);

            ImageData data = image.getImageData();
            System.out.printf("Captured raster: %d x %d pixels%n",
                    data.width, data.height);

            ImageLoader loader = new ImageLoader();
            loader.data = new ImageData[] { data };
            loader.save("eclipse-shell.png", SWT.IMAGE_PNG);
        } finally {
            if (gc != null) {
                gc.dispose();
            }
            if (image != null) {
                image.dispose();
            }
            display.dispose();
        }
    }
}

The code follows the workflow described in the question: find the active shell, create an SWT image, use GC.copyArea, obtain ImageData, and save through ImageLoader. The output dimensions printed by the program are the evidence you need when assessing quality. If the PNG is 1,920 × 1,080 pixels, that is the captured raster regardless of whether a viewer labels it 72 ppi, 96 ppi, or another density.

Client area versus the window frame

shell.getClientArea() describes the drawable content area. Window-manager borders, title bars, and other non-client decorations are not necessarily part of that rectangle. If your requirement is specifically the Eclipse content area, this is the appropriate scope. If you need the complete outer window including decorations, SWT's shell and graphics APIs do not provide a single, cross-platform guarantee that every window-manager frame will be included. Treat the capture scope as a requirement to verify on the operating system where the program runs rather than assuming that a larger DPI value will solve it.

Make the capture while the shell is stable

Capture after the controls have been laid out and painted. A minimized, undisplayed, zero-size, or partially updated shell can produce an empty or incomplete image. The example checks for a usable client rectangle, but it cannot make a shell visible or force a platform's window manager to repaint it. If you trigger the capture from a button, run it from that button's listener on the SWT UI thread and avoid disposing the shell until the copy finishes.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Verify pixels instead of trusting the DPI label

Use SWT itself to inspect the saved or in-memory raster:

ImageData data = image.getImageData();
System.out.println(data.width + " x " + data.height + " pixels");

You can also load the file again and verify the on-disk dimensions:

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
ImageLoader loader = new ImageLoader();
ImageData[] frames = loader.load("eclipse-shell.png");
if (frames.length == 0) {
    throw new IllegalStateException("PNG contained no image frames");
}
System.out.printf("File raster: %d x %d pixels%n",
        frames[0].width, frames[0].height);

For a normal PNG screenshot, the first frame is the raster you saved. Compare these dimensions with the shell size you intended to capture. If they are correct, a 72 ppi display is a metadata or viewer-label issue, not evidence that copyArea silently reduced the image.

Why changing DPI cannot create more detail

Suppose the file is 1,200 × 800 pixels. At 72 ppi, a print-oriented application may calculate a physical size of about 16.7 × 11.1 inches; at 144 ppi it may calculate about half those dimensions. The 1,200 × 800 pixels remain exactly the same. A density edit changes the physical-size interpretation, not the screenshot content.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

SWT's PNG saving path in the cited answer does not set DPI metadata. Consequently, an image viewer may apply its own default. If your destination is a print workflow that requires a particular density tag, set that metadata later with a tool that supports it, while recognizing that this changes print/display interpretation only. For reviewing screenshot sharpness, inspect pixel dimensions at 100% instead.

What SWT settings can and cannot do

SWT.HIGH is not a screenshot-resolution switch

The official SWT API uses SWT.HIGH to mean “high quality” in the context of SWT constants. It should not be read as a command to capture more screen pixels. Adding that constant to unrelated SWT calls will not turn a 72 ppi label into a denser raster.

Do not promise more pixels from a different API

The available sources do not establish that an alternate screenshot API captures more pixels than this SWT approach. The result is bounded by the display, operating-system scaling, shell size, and capture path. A larger source window or display can provide a larger raster, but the exact behavior is platform-dependent and must be checked in your deployment environment. Changing only the PNG's DPI field cannot overcome that limit.

Capture the right shell

Display.getActiveShell() returns the shell SWT considers active at that moment. If a modal dialog, preference window, or child shell has focus, it may be the object returned instead of the main workbench window. Log the shell's bounds or title before copying when diagnosing an unexpected image, and trigger the capture only after the desired shell is active.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

Common failures and fixes

The file says 72 ppi

Cause: SWT PNG saving did not write a DPI value and the viewer supplied a default.

Fix: inspect ImageData.width and ImageData.height. If those dimensions contain the expected pixels, the capture is not proven to be degraded.

The PNG is blank or smaller than expected

Possible causes: the shell had a zero-sized client area, was minimized, had not painted yet, or the capture happened while controls were changing.

Fix: capture after layout and painting, reject non-positive dimensions, keep the shell alive until copyArea returns, and print the measured dimensions. A successful file write alone does not prove that the intended content was present.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The wrong Eclipse window was saved

Cause: another shell was active when getActiveShell() ran.

Fix: make the target shell active first, then obtain it immediately before creating the GC. For deterministic automation, retain a reference to the specific shell you created instead of relying on whichever shell currently has focus.

Rank #4
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

Java reports a disposed SWT object

Cause: the shell, display, image, or graphics context was disposed before use.

Fix: perform the copy while all objects are alive and dispose them in the opposite order: graphics context, image, then display. The finally block in the example prevents common resource leaks.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The capture excludes the title bar or borders

Cause: the example allocates the image from the shell's client area, which is the drawable content region.

Fix: decide whether your specification is client content or the complete decorated window. SWT does not establish one portable method for including every platform window decoration, so test the required scope on each target operating system.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance, reliability, and file-format notes

Memory use grows with the raster's width, height, and pixel format. Dispose each temporary Image and GC promptly, especially when capturing repeatedly. Keep the capture on the UI thread because SWT graphics objects are tied to SWT's display lifecycle. If you need a sequence of screenshots, save each image before disposing it and record its dimensions alongside the filename so a later viewer label cannot be mistaken for a quality measurement.

PNG is appropriate when you want lossless screenshot pixels. The research for this question establishes the PNG workflow but does not establish a platform-specific comparison showing that another format or API would contain more pixels. Choose a different format only for a stated storage or delivery requirement, not because a DPI field looks low.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.

Or skip the browser setup

SWT is the right route for a local Eclipse desktop shell. If what you actually need is a screenshot of a web page, ScreenshotNeo provides a URL-based API instead of requiring you to install and manage a browser. It is not a replacement for capturing an arbitrary local desktop window, but it is useful for repeatable website captures.

One GET request returns a PNG, JPEG, WebP, or PDF. Before capture, ScreenshotNeo accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers identify the page verdict and whether it was billed. An MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients.

See the ScreenshotNeo API documentation for request options. The same service supports full-page captures with lazy images loaded, CSS-selector element captures, dark mode, device presets and custom viewports, retina scale, PDF paper and margin controls, custom CSS and JavaScript, pre-capture clicks, hidden selectors, selector/delay/network-idle waits, request and resource blocking, custom headers/cookies/user agents/Authorization, timezone and geolocation, transparent backgrounds, resizing, TTL-based caching, signed image links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, usage reporting, an OpenAPI specification, and familiar parameter names for easier migration.

cURL

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Python

import requests; r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90); open("shot.webp", "wb").write(r.content)

Node.js

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' }); const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

The Free plan includes 1,000 shots per month with no card. Paid plans start at $5 for 3,000 shots; yearly billing gives two months free, and every feature is on every plan. Sign up for the free ScreenshotNeo plan to try the web capture API without a card.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Practical decision checklist

  • Need the local Eclipse desktop shell: use SWT and verify ImageData pixel dimensions.
  • Seeing 72 ppi: treat it as a density label until the raster dimensions prove otherwise.
  • Need more detail: first check the source shell and display dimensions; metadata edits cannot add pixels.
  • Need a website screenshot rather than a desktop window: use a URL screenshot service such as ScreenshotNeo and inspect its verdict and billing headers.

Frequently Asked Questions

Can ScreenshotNeo capture my local Eclipse shell?

No. ScreenshotNeo captures a web URL through its API and MCP tools. Use the SWT method for an Eclipse desktop window; use ScreenshotNeo when the target is a website.

What if a dialog opens while I am capturing?

Because the example asks SWT for the active shell at capture time, a newly active dialog can become the captured shell. Make the intended shell active immediately before the copy, or retain and capture a reference to that specific shell.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.