xaml中不需要使用pack://可以直接使用source = " images/face 001 . png "。
程序中的uri可以用壹個字符串格式化,您使用的
string opera face = " pack://application:,,,/images/face 00 "+opera face index+"。png”;
如果operaFaceIndex是int,那不是錯誤嗎?
妳試試這個(vs2012通過測試):
Uri faceUri =新Uri(
字符串。Format("images/face{0:000}。png”),
烏裏金德。相對);