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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:50:49+00:00 2026-05-31T07:50:49+00:00

Here’s my problem- I’m trying to draw a circular part of a single image.

  • 0

Here’s my problem- I’m trying to draw a circular part of a single image.

I’m doing some work on a top-down dungeon crawler sort of game, and I’m attempting to make a light radius around the player. The floor is a single image, and I need to draw only a small, circular part of it. I’ve been looking at this method:

drawImage(Image img,
          int dx1, 
          int dy1,
          int dx2,
          int dy2,
          int sx1,
          int sy1,
          int sx2,
          int sy2,
          Color bgcolor, 
          ImageObserver observer) 

But, that looks like it would only draw a square subsection.
Does anyone happen to know an easier method than drawing tons of little squares to give the illusion of a circle?

Thanks

  • 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-05-31T07:50:51+00:00Added an answer on May 31, 2026 at 7:50 am

    You can do this with the setClip() method in Graphics.

    It needs some other work, but:

    import java.awt.Graphics;
    import java.awt.geom.QuadCurve2D;
    //...
    
      g.setClip(new QuadCurve()); // Set the bounding curve for the image.
      g.drawImage(...);
    

    As I said, it needs more work, meaning the QuadCurve2D object might need to be defined differently, but you can check the doc for that.

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

Sidebar

Related Questions

Here is the problem that I am trying to solve. I have two folders
Here is a broken down version of my problem : I have a method.
Here is the code in a function I'm trying to revise. This example works
Here is my work environment: Eclipse Juno as IDE with maven2 plugin on it
Here is what I am currently doing. PHP echo's out the recent post in
Here's the basic setup: I have a thin bar at the top of a
Here is my problem : I have a post controller with the action create.
Here's what I'm trying to accomplish with this program: a recursive method that checks
Here is the css: #content ul { font-size: 12px; } I am trying this:
Here my problem: @Assert\Regex( * pattern=/^[A-Za-z0-9][A-Za-z0-9\]*$/, * groups={creation, creation_logged} * ) I'm using the

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.