using namespace Windows::UI::Xaml::Media;
using namespace Windows::UI::Xaml::Media::Imaging;
Image图像处理
//Image
property ImageSource^ Image
{
ImageSource^ get()
{
return _Image;
}
void set(ImageSource^ value)
{
_Image = value;
OnPropertyChanged("Image");
}
}
void SetImage(Windows::Foundation::Uri^ baseUri, Platform::String^ path) //SetImage() in C# code
{
Windows::Foundation::Uri^ uri = ref new Windows::Foundation::Uri("ms-appx:///" + path);
Image = ref new BitmapImage(uri);
}
Windows::Foundation::Uri^ _baseUri = ref new Windows::Foundation::Uri("ms-appx:///");
SetImage(_baseUri, "SampleData/Images/60Banana.png");