H
H
HitGirl2019-05-24 11:11:35
WPF
HitGirl, 2019-05-24 11:11:35

Why does the program not find the resource?

Hello!
I added a picture resource through the project properties.
But this code throws an error:
Unhandled exception of type 'System.IO.IOException' in PresentationFramework.dll
Additional information: Could not find resource 'img1.jpg'.
Can you please tell me how to fix this error?
I don't use xaml file in my project.

Uri uri = new Uri("pack://application:,,/img1.jpg");
BitmapImage bitmap = new BitmapImage(uri);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
cyber_roach, 2019-05-25
@cyber_roach

here
for attention)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question