Image visible in Microsoft Blend Editor but not visible in Debugger

DonBaechtel-7903 141 Reputation points
2023-02-21T20:34:41.15+00:00

The image is visible in Microsoft Blend for VS 2022 Editor but is not displayed when Debugging. The title appears but the Image does not. Why? The background of the Image is White.

<Window x:Class="Cinetique_GUI.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:Cinetique_GUI"
        mc:Ignorable="d"
        Title="Cinetique  GUI" Height="1080" Width="1920" >
    <StackPanel>
        <Image Source="/Images/Logo-White-Crop.png" Stretch="Fill" Margin="5" Width="400" Height="150" HorizontalAlignment="Left"  />
    </StackPanel>
</Window>
Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,688 questions
Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,783 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,176 questions
{count} votes

Accepted answer
  1. Hui Liu-MSFT 48,571 Reputation points Microsoft Vendor
    2023-02-22T06:56:39.9433333+00:00

    Hi,@Don Baechtel. Welcome Microsoft Q&A.

    You could check whether the properties of your images are Resources. What is the path to your image's location in the project? Can you show a screenshot of your project structure?

    Project structure:

    User's image

    Property of image

     <Image Source="Images\li.png" Stretch="Fill" Margin="5" Width="300" Height="100" HorizontalAlignment="Left"  />
    
    

    You could Rebuild the project after checking and then running to see if it works.

    The result:

    User's image


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.