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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T14:49:31+00:00 2026-05-29T14:49:31+00:00

This seems simple, but it’s not working for me. I’d like to display an

  • 0

This seems simple, but it’s not working for me. I’d like to display an image from my DB, and overlay a polygon from the same DB, using the same coordinate system.

<Image Name="imgColl" Stretch="Fill" MaxWidth="190" MinHeight="70">
    <Image.Source>
        <DrawingImage>
            <DrawingImage.Drawing>
                <DrawingGroup>
                    <ImageDrawing ImageSource="{Binding ImageData}" Rect="0,0,590,590"/>
                    <GeometryDrawing Geometry="{Binding Coordinates, StringFormat=M\{0\}}">
                        <GeometryDrawing.Pen>
                            <Pen Thickness="4" LineJoin="Bevel" Brush="OrangeRed"/>
                        </GeometryDrawing.Pen>
                    </GeometryDrawing>
                </DrawingGroup>
            </DrawingImage.Drawing>
        </DrawingImage>
    </Image.Source>
</Image>

I find that I have to specify the Rect on the ImageDrawing object. This is unfortunate because the images I’m loading are of different sizes. But if I don’t specify the Rect, the image doesn’t appear when running the app. If I make the image big enough (as in the example), the image does appear, and it gets resized to fit my control, but the polygon coordinate system doesn’t seem to match.

Also, I’ve used StringFormat to put an M in front of the Geometry specification, so that it comes out like this: “M50,50,12,50,30,30,30,100,100,100”. If I specify that explicitly, the polygon appears, but if I bind it with the same string, the polygon doesn’t appear.

Not sure if those two problems are related to one another–I’ll have to re-evaluate when either of the two is fixed. Thanks for any guidance you have to offer!

  • 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-29T14:49:32+00:00Added an answer on May 29, 2026 at 2:49 pm

    The StringFormat setting of the binding is ignored here, since the target type of the binding is not a string, but a Geometry.

    The string returned by your Coordinates property is implicitly converted into a Geometry, because Geometry has a [TypeConverterAttribute(typeof(GeometryConverter))] attribute setting, but the StringFormat won’t be applied . You will need to add a binding Converter.

    For the other problem concerning ImageDrawing.Rect: as far as i’ve understood ImageDrawing, you always have to specify the drawing rectangle, it is Rect.Empty by default. Maybe you can also bind the Rect property to some property of your data object.

    Anyway, wouldn’t it be a lot simpler to define something like this, in order to maintain a common coordinate system for image and polygon?

    <Viewbox MaxWidth="190" MinHeight="70">
        <Canvas>
            <Image Stretch="None" Source="{Binding ImageData}" />
            <Path Stroke="OrangeRed" StrokeThickness="4" StrokeLineJoin="Bevel"
                  Data="{Binding Coordinates}" />
        </Canvas>
    </Viewbox>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This seems simple, I am trying to set a bitmap image but from the
This seems like it should be simple but I can't work it out from
This seems like something simple but I'm not able to get the syntax correct.
This seems like it should be very simple but I can't get it to
this seems like a simple enough question but I can't seem to find a
This seems like a simple question, but it is difficult to search for. I
This seems like a simple question, but has proven to be difficult to find
This seems like it should be really simple, but I'm unable to figure this
This seems like it would be fairly simple, but I've been unable to find
This seems like it should be so simple, but apparently it isn't. I have

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.