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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:43:09+00:00 2026-05-14T15:43:09+00:00

I created a bufferedimage which i applied to a Rectangle to use as filling

  • 0

I created a bufferedimage which i applied to a Rectangle to use as filling pattern to shape S. If i change S’s position, the filling pattern changes with it instead of remaining “fixed”. What could it be?

Image: (the pattern is a 3 stripes, all with the same aspect ratio) :alt text http://img88.imageshack.us/img88/8524/imageby.png

    if (bannerPatternCreated == false) {

        banner = new BufferedImage(size * 3, size * 3, BufferedImage.TYPE_INT_RGB);
        Graphics2D gc = banner.createGraphics();


        System.out.println("Creating banner...");

        gc.setColor(Color.black);
        gc.fillRect(0, 0, size, size * 3);

        gc.setColor(Color.BLUE);
        gc.fillRect(size, 0, size, size * 3);

        gc.setColor(Color.WHITE);
        gc.fillRect(size * 2, 0, size, size * 3);
        gc.dispose();
        bannerPatternCreated = true;

    }

    Rectangle patternPencil = new Rectangle(size, size);
    g2.setPaint(new TexturePaint(banner, patternPencil));

    Rectangle recto = new Rectangle(presentX-size, presentY-size, size, size);
    g2.fill(recto);
  • 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-14T15:43:09+00:00Added an answer on May 14, 2026 at 3:43 pm

    It looks like the texture position is fixed, and so when you move recto around you’re just getting a different view of the underlying infinitely-repeating texture.

    If you change the patternPencil rect to be the same size/position as recto, I think it should get sorted:

    Rectangle patternPencil = new Rectangle(presentX-size, presentY-size, size, size);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a BufferedImage which is created from a png file. When creating it
I have a transparent BufferedImage created with the following code(not relevant how it is
I created a JButton which has an image set as an icon representing the
I created a PHP Drop Down which is populated from a MySql Database and
I have a collection of BufferedImage instances, one main image and some subimages created
I have created a graphical image with the following sample code. BufferedImage bi =
I have the following problem: I created the servlet which should draw a dynamic
I created an ARGB BufferedImage. Now I'd like to reinitialize it with a transparent
I have created an application which requires the reloading of an image several times
I have a Arraylist, which i want to save in a file for use

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.