integrating-wpf-medialisted
Install: claude install-skill christian289/dotnet-with-claudecode
# WPF Media Integration Patterns
Integrating multimedia content such as images, video, and audio in WPF.
## 1. Image Control
### 1.1 Basic Image Display
```xml
<!-- Resource image -->
<Image Source="/Assets/logo.png" Width="100" Height="100"/>
<!-- Absolute path -->
<Image Source="C:\Images\photo.jpg"/>
<!-- URI -->
<Image Source="https://example.com/image.png"/>
<!-- Pack URI (embedded resource) -->
<Image Source="pack://application:,,,/MyAssembly;component/Images/icon.png"/>
```
### 1.2 Stretch Options
```xml
<!-- None: maintain original size -->
<Image Source="/photo.jpg" Stretch="None"/>
<!-- Fill: stretch to fit area (ignore aspect ratio) -->
<Image Source="/photo.jpg" Stretch="Fill"/>
<!-- Uniform: maintain aspect ratio, maximum size within area -->
<Image Source="/photo.jpg" Stretch="Uniform"/>
<!-- UniformToFill: maintain aspect ratio, fill area (may crop) -->
<Image Source="/photo.jpg" Stretch="UniformToFill"/>
```
### 1.3 Dynamic Image Loading
```csharp
namespace MyApp.Helpers;
using System;
using System.IO;
using System.Windows.Media;
using System.Windows.Media.Imaging;
public static class ImageHelper
{
/// <summary>
/// Load image from file
/// </summary>
public static BitmapImage LoadFromFile(string filePath)
{
var bitmap = new BitmapImage();
bitmap.BeginInit();
bitmap.UriSource = new Uri(filePath, UriKind.Absolute);
bitmap.CacheOption = BitmapCacheOption.OnLoad;
bitmap.EndInit();