logo
  • 教程列表
  • SO官方文檔
  • 圖片
    • 將 BitmapImage 指定給 Image 的 Source
    • 將 WriteableBitmap 儲存到流
    • 將 BitmapImage 與 Image 控制元件一起使用
    • 使用 RenderTargetBitmap 將控制元件渲染為影象
    • 將點陣圖(例如,從剪貼簿內容)轉換為 PNG
    • 在 XAML 中載入影象
    • 從程式碼中的資產載入影象
    • 從 StorageFile 載入影象
    • 將 UI 元素渲染到影象
  1. StackOverflow 文件
  2. uwp 教程
  3. 圖片
  4. 從程式碼中的資產載入影象

從程式碼中的資產載入影象

Created: November-22, 2018

 ImageSource result = new BitmapImage(new Uri("ms-appx:///Assets/Windows_10_Hero.png"));

使用 result 來設定 Image 控制元件的 Source 屬性,無論是 Binding 還是程式碼隱藏

  • 從 StorageFile 載入影象
  • 在 XAML 中載入影象

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明