“Cannot convert string to ImageSource.” How can I do this?

前端 未结 7 1626
南旧
南旧 2021-01-13 11:09
private void HeroMouseEnter(object sender, MouseEventArgs e)
    {
        ((Image)sender).Source = GetGlowingImage(((Image)sender).Name);            
    }

    pub         


        
7条回答
  •  孤独总比滥情好
    2021-01-13 11:53

    You probably want to return a BitmapSource. This MSDN article has an example of how to create a BitmapSource from an image file.

提交回复
热议问题