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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:04:51+00:00 2026-06-04T19:04:51+00:00

Usually when I need a background that changes to match the size of the

  • 0

Usually when I need a background that changes to match the size of the content, I would use a nine-patch image.

I tried that for a graphic that was transparent except for a dashed outline with rounded corners. However, it ended up stretching the dashes, instead of repeating the pattern of dashes.
The image shows three lines:
1. The basic, small image
2. How the image looks when I stretch it
3. How the image should look
enter image description here

Is there a way to do this with a nine-patch image?

If not, what is the recommended alternative? I think it might be possible to use shapes and XML files to simulate it, but I’m not exactly sure how to do that or how to have the corners rounded.

And again, the reason why I don’t use a basic image is because this dashed outline would surround a box that may contain a little content or a lot.

  • 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-04T19:04:54+00:00Added an answer on June 4, 2026 at 7:04 pm

    You could create a canvas and then load the image on the canvas. To combat the problem with anti-aliasing, draw a rounded rectangle and mask it onto your image. When you draw the image, use the porter-duff Xfer mode of paint. You can control the stroke through paint as well, controlling the spacing and length of the lines just how you would like.

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

Sidebar

Related Questions

I usually use Dispatcher.Invoke when i need to access some UI elements from background
Usually when I need to find the max value of an array I use
I need to develop a easy web site, I usually use bootstrap CSS framework,
I don't usually use regular expressions, hence my question. I need a regex to
I need to have a floated element after the content/text that's supposed to flow
Possible Duplicate: Why is string concatenation faster than array join? Usually we need to
Sometimes I need to find some strings inside DB usually it is just host-name
Usually I worked with PostgreSQL and never had a problem, but now I need
Every now and then I need to call new[] for built-in types (usually char
I often need to remove lists of columns from a data.frame. I usually do

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.