C# WPF-如何获取图像的URI源?
我想获取在XAML中创建的图像的URI源。图像的源是位图帧。我知道可以将BitmapImage.UriSource用于BitmapImage,但是BitmapFrames呢 要获取位图帧,我使用:C# WPF-如何获取图像的URI源?,c#,wpf,image,uri,bitmapframe,C#,Wpf,Image,Uri,Bitmapframe,我想获取在XAML中创建的图像的URI源。图像的源是位图帧。我知道可以将BitmapImage.UriSource用于BitmapImage,但是BitmapFrames呢 要获取位图帧,我使用: private void imgs_Loaded(object sender, MouseEventArgs e) { Image img = (Image)sender; BitmapFrame frame = (BitmapFrame)img.Sou
private void imgs_Loaded(object sender, MouseEventArgs e)
{
Image img = (Image)sender;
BitmapFrame frame = (BitmapFrame)img.Source;
//How to get frame's UriSource?
}
你检查过酒店了吗?那么如何在XAML中创建位图帧呢?URI可以指向图像,但图像可以不带URI而存在。最好在创建图像之前记录每个图像对象到URI的映射,然后根据事件处理程序中获得的图像从该列表中查找URI。