■ Compositor 클래스의 CreateVector3KeyFrameAnimation 메소드를 사용해 Vector3KeyFrameAnimation 객체를 만드는 방법을 보여준다.
▶ 예제 코드 (C#)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
using System; using Microsoft.UI.Composition; using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Hosting; using Microsoft.UI.Xaml.Media.Imaging; // ... Image image; // ... BitmapImage bitmapImage = new BitmapImage(new Uri("ms-appx:///Assets/landscape.png")); bitmapImage.DecodePixelWidth = 800; bitmapImage.DecodePixelHeight = 600; image.Source = bitmapImage; Visual imageVisual = ElementCompositionPreview.GetElementVisual(image); Compositor compositor = imageVisual.Compositor; Vector3KeyFrameAnimation scaleAnimation = compositor.CreateVector3KeyFrameAnimation(); |