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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:15:24+00:00 2026-05-29T11:15:24+00:00

Im making a program using Java for android. I’m drawing alot of rectangles on

  • 0

Im making a program using Java for android.
I’m drawing alot of rectangles on a bitmap using 4 lines connecting. ATM the lines are black and the background is white, i want to fill these “boxes” with colour and i cant figure out how to do it.
to change from drawing 4 lines into making a box from the start is not an option, i have to draw lines that form a box.
im thinking of something that takes an argument of x,y in the middle of the “box” and then filling it with pixles until it hits the edge of the box but i cant get it to work.
it needs to be reapeteble too, i have alot of boxes to fill.

im using android 2.1 with API 7

  • 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-29T11:15:25+00:00Added an answer on May 29, 2026 at 11:15 am

    You can quite simply do this with a Path. It works as you’re talking about — move from point to point “drawing lines” — but when you’re done you can fill it.

    Paint paint = new Paint();
    paint.setStyle(Style.FILL);
    // set other paint parameters, like color...
    ...
    
    Path path = new Path();
    path.moveTo(startX, startY);
    path.lineTo(startX, startY + 50);
    path.lineTo(startX+50, startY + 50);
    path.lineTo(startX+50, startY);
    canvas.drawPath(path, paint);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making an android program that retrieves content of a webpage using HttpURLConnection. I'm
I am making a program such as Alice from Carnegie Melon University using JAVA.
I`m making a GUI for my java program using Swing Components and Netbeans IDE.
Possible Duplicate: Shutting down a computer using Java I am making a personal program
I'm making a cryptography/cryptanalysis program using java as a homework for my master. Anyway,
I am using the cool map making program DIY map and i want to
I am making a request to a CGI program using AJAX. The response sends
I am making a pig latin translater using JFrame in Java. Here's my problem;
In a program (Java) I'm making I need to check for a specific pin
I'm making an XMLParser for a Java program (I know there are good XMLParsers

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.