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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:55:07+00:00 2026-05-11T13:55:07+00:00

I what to draw a circle that uniformly fits into its space, with a

  • 0

I what to draw a circle that uniformly fits into its space, with a constant a stoke thickness. A ViewBox gets me the uniform fit, but not the constant stoke thickness.

<Viewbox Stretch='Uniform' MinHeight='10' MinWidth='10' >     <Ellipse Height='10' Width='10' Fill='Red' StrokeThickness='1' Stroke='Yellow'/> </Viewbox> 
  • 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. 2026-05-11T13:55:07+00:00Added an answer on May 11, 2026 at 1:55 pm

    If you don’t specify a width or height of the ellipse, the default values will be ‘Auto’. Combined with the default HorizontalAlignment/VerticalAligment values of ‘Stretch’, this should cause the ellipse to ‘stretch’ to the width and height of its container (with constant stroke thickness).

    The *ContentAlignment properties of the parent container may affect this behavior, but again, the default, unset values should give you the behavior you want.

    Edit: revising my suggestion because I did not realized the ellipse must remain a circle (don’t worry, I’ve decided to pick up a copy of ‘Reading for Comprehension’).

    I suggest you bind the width and height properties of the ellipse to a MultiBinding of the parent container’s ActualWidth and ActualHeight properties. Then implement a ‘multi-value converter’ that will return the minimum value from the multi-binding.

    So the converter might look like this:

    class MinimumValueConverter : IMultiValueConverter {     public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)     {         return values.Cast<double>().Min();     }      public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)     {         throw new NotImplementedException();     } } 

    And the ellipse properties could be bound like this:

    <Window.Resources>     <l:MinimumValueConverter x:Key='MinimumValueConverter' /> </Window.Resources> <Ellipse Stroke='Black' StrokeThickness='1'>     <Ellipse.Width>         <MultiBinding Converter='{StaticResource MinimumValueConverter}'>             <Binding RelativeSource='{RelativeSource FindAncestor, AncestorType={x:Type UIElement}}' Path='ActualWidth' />             <Binding RelativeSource='{RelativeSource FindAncestor, AncestorType={x:Type UIElement}}' Path='ActualHeight' />         </MultiBinding>     </Ellipse.Width>     <Ellipse.Height>         <MultiBinding Converter='{StaticResource MinimumValueConverter}'>             <Binding RelativeSource='{RelativeSource FindAncestor, AncestorType={x:Type UIElement}}' Path='ActualWidth' />             <Binding RelativeSource='{RelativeSource FindAncestor, AncestorType={x:Type UIElement}}' Path='ActualHeight' />         </MultiBinding>     </Ellipse.Height> </Ellipse> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im looking for a way to draw the OUTLINE of a circle that will
How to draw circle on mouse dragged event, and then how to move that
I'm trying to draw a circle in c using opengl, that's smaller than the
I'm trying to draw a google maps that has multiple Circle overlays, however I
I've got a circle that I've drawn on a canvas. I'd like to draw
How to draw a circle on a form that covers the whole working area?
For an iPhone application I want to draw a circle, that is only for
I am trying to draw circle on an JPEG image which load into my
When trying to draw a circle on an image using cv.Circle, I realized that
I want to draw circle, and i want to re size it based on

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.