Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8838229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:56:17+00:00 2026-06-14T09:56:17+00:00

I need to fit a huge image (BufferedImage to access colors etc) into a

  • 0

I need to fit a huge image (BufferedImage to access colors etc) into a JScrollPane derived class. Nothing very hard until there.

The image is a JPG scan of an A3 sample of material, its size is 13030×20840 pixels, 24bits, and weights 12MB on disk -> about 800MB in RAM.

I embedded the BufferedImage into a Jpanel, which lies as the Scrollpane’s view.

When I try to scroll/drag my image, it takes seconds to respond, so it is not very handy.

I need your help in order to know what I should do to render the scrollpane’s scrolling and the image dragging as smooth and reactive as possible, but I easily figure out that with such an image it could be impossible.

I tried many options, such as double buffering, etc. but I’m quite new to Swing, then it is greatly possible I missed some simple solution.

If there is a need to change the BufferedImage by something else, or whatever, I’m receptive to any solution.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T09:56:18+00:00Added an answer on June 14, 2026 at 9:56 am

    So, we have a large 13,030 x 20,840 pixel image.

    if we break this image into 256 x 256 pixel tiles, we get a tile set that’s 51 tiles across and 82 tiles down. The last tiles in the rows and columns will be partial images, since 256 doesn’t go evenly into 13,030 and 20,840.

    Let’s assume our display window is 400 X 400 pixels. Let’s also assume were starting in the upper left hand corner of the large image.

    We take and make a 3 x 3 tile buffered image. This would be 768 x 768 pixels, which allows enough overlap for smooth scrolling. We take the first 3 tiles from the first row, the first 3 tiles from the second row, and the first 3 tiles from the third row to make our 3 x 3 tile buffered image.

    Now, when we set up the horizontal and vertical scroll on the JScrollPane, we have to set the maximum value on the horizontal scroll to 13,030 and the maximum value on the vertical scroll to 20,840. This is so the user is kinetically aware that he is scrolling a large image.

    Ok, we display the 3 x 3 tile buffered image. The user scrolls to the right to see more images. The user has scrolled 256 pixels.

    The application now has to build a new 3 x 3 tile buffered image. We take the 2nd through 4th tiles from the first row, second row, and third row. We display this new buffered image. To the user, it looks like one huge image. To the application, a series of small 3 x 3 tile buffered images are displayed.

    mKorbel has already created some code which builds and displays these smaller buffered images on the fly.

    To deal with zooming, you can resize the large image outside of the Java application and create more than one tile set. This makes the Java application code more complicated, but much faster than trying to resize the smaller buffered images in the Java application.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to fit a text into a div inside in my template. Now
I need to fit my data into a Beta distribution and retrieve the alpha
I need to fit the following structure into int64. day 9 bit (0 to
I need to fit an image inside a 300x300 div without stretching the image.
I need to fit 10 data points ( x,y ) into this equation: ay²
I need to fit two video streams on to each other. I need to
I need to adjust my jqgrid height dynamically to fit in the browser window
I have a background that I need fit in all screen sizes. I have
I need to fit some points from different datasets with straight lines. From every
I have a set of data (in ArrayCollection) and I need to fit a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.