Linked Questions
32 questions linked to/from How to load image to WPF in runtime?
4 votes
2 answers
11k views
How to make Uri reference to a Resource image embedded in the assembly itself? [duplicate]
In my assembly project I have a .png image which it's Build Action is set to Resource. Now I want to make the following: _myIcon = new BitmapImage(new Uri(**path to the image embedded on the ...
1 vote
1 answer
3k views
Changing Image Source property when Button is clicked [duplicate]
I have added an image(image1) in my Xaml Editor, changed the source property to Source="/WpfApplication9;component/Images/a.png" I have a button, I want is, if I Clicked that button I want my image1 ...
-1 votes
1 answer
3k views
How to set image source in WPF programmatically [duplicate]
I am trying to set an image source in WPF but relative Uri doesn't work. imgView.Source = new BitmapImage(new Uri("Res/Images/img.png", UriKind.Relative)); But this works: imgView.Source = new ...
0 votes
1 answer
2k views
What is the right way to specify the image source in WPF? [duplicate]
I want to use a background image for a window in WPF. I am intending to use ImageBrush. I have the image in the root folder and also in the Assets folder. I found many answers in StackOverflow to ...
1 vote
1 answer
765 views
How to change button image background in WPF C# [duplicate]
I'm trying to change the image in a WPF application in C# when I click on a button. The image is like the background of the button, but I can't figure out how to change the image. Could someone give ...
0 votes
0 answers
837 views
Loading pictures dynamically from Resources folder in WPF C# [duplicate]
I am new to WPF and am confused as to how to load an image dynamically from a folder in the project rather than from OpenFileDialog. I have a regular grid view in XAML where I've declared an image <...
0 votes
1 answer
646 views
ImageBrush (Canvas) path not working [duplicate]
I am working on WPF for interactive applications. When I assign image path to ImageBrush (Canvas) from folder included in solution, its not working, it goes to bin/debug/.. in WPF. But it worked ...
0 votes
1 answer
548 views
How to add an image in a WPF button [duplicate]
I tried to get it done by doing this <Button> <StackPanel> <Image Source="Pictures/img.jpg" /> <TextBlock>Blablabla</TextBlock> </...
0 votes
0 answers
425 views
WPF Animate Image Source - Images Fail To Load [duplicate]
I want to animate the Source property of an image in WPF using a ObjectAnimationUsingKeyFrames. My images "0.png" and "1.png" are in a folder called "Assets". Both have &...
0 votes
2 answers
481 views
How to change absolute URI to relative? [duplicate]
I wish I could change the path of the source image, to match the folder of my project. Current code img1.Source = new BitmapImage(new Uri("C:/Users/User/Documents/Visual Studio 2015/Projects/...
0 votes
0 answers
387 views
Why cant I assign Bitmap to Image.Source? [duplicate]
void VideoCaptureDevice_NewFrame(object sender, NewFrameEventArgs eventArgs) { pictureBox1.Source = (Bitmap)eventArgs.Frame.Clone(); } on Windows Form this works ...
3 votes
0 answers
290 views
Cannot insert/locate find .png picture [duplicate]
I have found some code online that I can use on my own project. It's fairly simple, but when I run the program, I get an error message that it can not find the resource. I have tried a lot and simply ...
0 votes
1 answer
894 views
How to show images in C# WPF [duplicate]
I am a first year computer science student and I am having a really hard time with C#. I have been given a task where I have to create a wpf, where images have to appear and when my mouse lands on ...
1 vote
0 answers
184 views
WPF Image doesnt show in application but doesnt have error in the code [duplicate]
I am making an application where users can make an account and add a profile image. In my Main_Page I have an Image in the Main_Page.xaml.cs I am setting Image.Source = image. image is a BitmapImage. ...
0 votes
0 answers
178 views
Load PNG from code behind [duplicate]
I try to load a png file depending on a message type form code behind, but without success. In XAML it works if I define the image source as follows: <Image Name="MessageTypeImage" DockPanel.Dock="...