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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:59:43+00:00 2026-06-06T04:59:43+00:00

I have an image in WPF that I would like to have display different

  • 0

I have an image in WPF that I would like to have display different information based upon where the mouse is currently hovering. I know I’ve seen this in websites, I just can’t seem to figure out the code to do it in WPF.

The image I’m using is a US map, and I need state specific info to appear as the user crosses the borders. Right now the implementation I’m using is a series of Paths drawn in transparent on top of the map, and then using the Mouse.MouseEnter event to trigger the change. The problem is that the updating seems to suffer from horrible lag, or else the MouseEnter event isn’t always catching properly.

Does anybody know of a better way to do this?

Sample C#

    private void wyoming_MouseEnter(object sender, MouseEventArgs e)
    {            
        //stateName.Text = "Wyoming";            
    }

Sample XAML

<Canvas MouseDown="Canvas_MouseDown" Name="canvas">
    <Viewbox Stretch="Uniform">
        <Image Source="USA.png" />
    </Viewbox>
    <Path Name="wyoming" Stroke="Transparent" StrokeThickness="1" Mouse.MouseEnter="wyoming_MouseEnter" Mouse.MouseMove="wyoming_MouseMove">
        <Path.Data>
            <PathGeometry>
                <PathGeometry.Figures>
                    <PathFigureCollection>
                        <PathFigure IsClosed="True" StartPoint="184,121" >  <!--NW-->
                            <PathFigure.Segments>
                                <PathSegmentCollection>
                                    <LineSegment Point="266,129" />
                                    <LineSegment Point="264,193" />
                                    <LineSegment Point="203,190" /> 
                                    <LineSegment Point="177,186" /> 
                                </PathSegmentCollection>
                            </PathFigure.Segments>
                        </PathFigure>
                    </PathFigureCollection>
                </PathGeometry.Figures>
            </PathGeometry>
        </Path.Data>
    </Path>
</Canvas>
  • 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-06T04:59:44+00:00Added an answer on June 6, 2026 at 4:59 am

    Personally what I did for this same instance (except I was labeling info pertaining to time zones and broadcast areas) was I made transparent path shapes for the areas I want able to be activated on mouseover and laid them over a U.S. Map, then I attached an Event trigger to each for the MouseEnter/MouseLeave events so when the user would mouse over the area of whatever Path, it would fire off that condition and do the action specified….in my instance it was showing radio station broadcast times and programs based on region and time zone. So if an are was Moused over, an info box visibility was set to Visible. On MouseLeave that same info box was set to Collapsed….etc

    It was very effective and worked real well and you can make your interactive areas very defined when using the precise shapes you made with your Paths. If I can dig up the source I’ll try and share but the project was over a year ago so hopefully the description gives you enough of an idea to get the creativity going. 🙂

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

Sidebar

Related Questions

I have a 16 bit grayscale image that I want to display using WPF
I would like to have an image animation in wpf where the image shakes
I have a WPF combobox that I would like to bind to an observable
I want my WPF application to have a ToggleButton that contains an image of
I have the following xaml for changing the image for WPF button when mouse
I would like to create a set of custom controls that are basically image
I display images in my WPF app using BitmapImage . However, I would like
I have a WPF assembly in which I would like to embed five icons
I have a simple class that contains a string and an WPF Image control:
I have a small WPF application where i am displaying an image. I would

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.