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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:07:21+00:00 2026-05-13T20:07:21+00:00

I have the below definition for a DrawingBrush. It is an exmaple I found

  • 0

I have the below definition for a DrawingBrush. It is an exmaple I found online that draws an arrow:

<DrawingBrush x:Key="arrow" Stretch="Uniform">
  <DrawingBrush.Drawing>
    <DrawingGroup>
      <DrawingGroup.Children>
        <GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M 358.447,332.449L 358.447,319.664L 380.875,319.664L 380.798,309.408L 407.698,326.505L 381.068,343.628L 380.982,332.45L 358.447,332.449 Z "/>
      </DrawingGroup.Children>
    </DrawingGroup>
  </DrawingBrush.Drawing>
</DrawingBrush>

Now, I created a rectangle on my Canvas and set the rectangle’s Fill property to the above DrawingBrush:

<Rectangle Fill="{DynamicResource arrow}" Stroke="#FF000000" Width="Auto" Height="Auto" Canvas.Top="339.815" Canvas.Left="112.037" x:Name="arrowRectangle"/>

With the rectangle’s Width and Height set to “Auto”, I expected the rectangle to resize to automatically display the arrow that is drawn. However, it seems that I need to explicitly set a Width/Height in order to see anything. If I leave the Width/Height as Auto, the rectangle is displayed as a single point, as if Width = Height = 0.

It seems that I am misunderstanding how the DrawingBrush works. I am just looking for a way to display an arrow. Would I have to use an Image instead of a DrawingBrush? I looked for a DrawingBrush first because I thought for such a simple thing as an arrow it would work fine.

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-13T20:07:21+00:00Added an answer on May 13, 2026 at 8:07 pm

    DrawingBrush is just another brush, which doesnt have layout sizing, so it will just try to fill the area of the control in which it is called. So you cant expect brush controlling the Rectangle sizing.
    But you can use a Path with this Geometry as DataProperty

    <Path Fill="Red" Data="F1 M 358.447,332.449L 358.447,319.664L 380.875,319.664L 380.798,309.408L 407.698,326.505L 381.068,343.628L 380.982,332.45L 358.447,332.449 Z " Stretch="Uniform" ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have below a list of text, it is from a popular online game
I am trying to learn more about regular expressions I have one below that
I have the below code that links and runs fine in 32bit mode -
Suppose I have the following table definition: CREATE TABLE x (i serial primary key,
I have a project that adds elements to an AutoCad drawing. I noticed that
I have the below query, which basically it retrieves the 5 top most books
I have the below code in stdafx.h. using namespace std; typedef struct { DWORD
The code I have pasted below is meant to display images on the middle
I am trying to manipulate a string using Jython, I have included below an
Below I have a very simple example of what I'm trying to do. I

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.