zoukankan      html  css  js  c++  java
  • uwp 之资源的访问

    访问image资源

    -----------------------------------------------------------------------------

    BitmapImage bitmapImage = new BitmapImage();
    img.Width = bitmapImage.DecodePixelWidth = 80; //natural px width of image source
    // don't need to set Height, system maintains aspect ratio, and calculates the other
    // dimension, so long as one dimension measurement is provided
    bitmapImage.UriSource = new Uri(img.BaseUri, "xml/3.png");
    img.Source = bitmapImage;

    声音

    ------------------------------------------------------------------------------

    MediaPlayer player = new MediaPlayer();
    private void media_Click(object sender, RoutedEventArgs e)
    {
    player.Source = MediaSource.CreateFromUri(new Uri("ms-appx:///Assets/AlarmSound.wma"));
    player.Play();
    }
    private void MainPage_Unloaded(object sender, RoutedEventArgs e)
    {
    player.Dispose();
    // throw new NotImplementedException();
    }

  • 相关阅读:
    堆排序算法
    基数排序
    快速排序
    OpenSSL加密证书
    jobs后台任务
    at,crontab例行性任务
    dns
    ftp
    ssh
    iptables
  • 原文地址:https://www.cnblogs.com/bruce1992/p/14221384.html
Copyright © 2011-2022 走看看