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

  • Home
  • SEARCH
  • 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 8557689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:37:52+00:00 2026-06-11T15:37:52+00:00

I anticipate using some images in my Java application. These images will be drawn

  • 0

I anticipate using some images in my Java application. These images will be drawn onto my JPanel using g.drawImage(). The JPanel is resizable and the images should scale as the JPanel increases/decreases in size

Two questions:

  1. What image format is best for this type of desired scalable image? For instance, in this application, an image of size 100×100 may be scaled into an image of size 30×30 or 10×10 or 300×300.
  2. How can I write code to do this scaling?
  • 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-11T15:37:53+00:00Added an answer on June 11, 2026 at 3:37 pm

    Take a look at Java: maintaining aspect ratio of JPanel background image

    I’d also take a read through The Perils of Image.getScaledInstance() and I’d also have a look at java-image-scaling (I’ve not used it personally, but I’ve heard good things about it).

    As to the image format. I doubt it will really make that much of difference, the quality will be determined by the quality of the original image. Try and use a large image and scale it down, rather then trying to scale a small image up.

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

Sidebar

Related Questions

I'm creating a database with what I anticipate will be a long (perhaps several
I will first explain why I need it, because I anticipate that the first
I currently have a working, simple language implemented in Java using ANTLR. What I
I'm writing a web application using the google maps api v3, which displays places
I am using sqlite for my iphone and I anticipate the database schema might
I'm using git svn to get some git goodness with the company-mandated svn server.
I am working on a small application that is meant to call some (really
I'm using kinit to log into a server that my sys admin didn't anticipate
We're using JBoss Drools to externalise some particularly prone to change business logic in
Summary: I'm developing a persistent Java web application, and I need to make sure

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.