LoginSignup
3
2

More than 5 years have passed since last update.

VS Image LibraryのXAML形式ファイルを画像として使う

Posted at

概要

Visual Studio Image Libraryに含まれる、XamlファイルをWPFでImageのSourceとして使うためのメモ。

手順

  1. リソースに、次の内容を追加する。

    <DrawingImage x:Key="">
        <DrawingImage.Drawing>
            <!-- DrawingGroup -->
        </DrawingImage.Drawing>
    </DrawingImage>
    
  2. 追加したい画像の、DrawingGroup要素を先のコメントの箇所に丸々コピーする

  3. Keyに名前を付ける

  4. ImageのSourceで、作成したリソースをStaticResourceとして参照する

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2