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 8699155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:52:45+00:00 2026-06-13T01:52:45+00:00

I am handling a SVG file in Java using Batik library. The problem occurs

  • 0

I am handling a SVG file in Java using Batik library. The problem occurs when i scale it. I can see pixels of lines. Off course this should not happen, i should be able to zoom at least about 4000% and maintain the smoothness.

SVG file is read from an extended class, and it is painted from an override paint method. First i set new scale to AffineTransform variable, apply this to graphics of the method and paint using super.paint().

I am really stuck and can’t figure out the problem. SVG files I am using are ok, I opened them in Inkscape and could zoom without the pixels showing. Please help.

code:

@Override
public void paint(Graphics g) {
  try {
    rad = (int)(radInit*zoom);
    updateTransform();

    Graphics2D g2d = (Graphics2D) g;
    g2d.setTransform(transform);

    super.paint(g);
    paintElements(g2d);
  } catch(NullPointerException nulle) {
    // System.out.println("SVG not loaded yet");
  }
}

private void updateTransform(){
  transform = new AffineTransform();
  transform.translate((-1)*zoom*centarX, (-1)*zoom*centarY);
  transform.scale(zoom, zoom);                      
}
  • 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-13T01:52:46+00:00Added an answer on June 13, 2026 at 1:52 am

    What was needed was

    this.setRenderingTransform(transform, true);
    

    This way no pixels can be seen or rather, everything is painted as it should be.

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

Sidebar

Related Questions

Problem: handling translations, (and maybe also retrieving/storing plugin preferences and file structure), all on
I'm using the Handling file upload example. When uploading a file, the server shows
I'm working on handling file uploads using express.js and node, and have the basic
I am handling a uploading image file using PHP, then using ImageMagick to create
I'm handling a problem in downcasting a query.uniqueResult() using hibernate. I have 2 classes:
Exception Handling in java based we services JAX-WS. I want to create user defined
Possible Duplicate: Handling InterruptedException in Java I wonder how InterruptedException should be properly handled.
I would like to edit SVG files using some scripting language (preferably Python). In
I was handling some events using the following code with jQuery 1.7.2 : $().on('focus
I'm using the D3 javascript library to dynamically change line thicknesses. What I want

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.