Skip to content

Instantly share code, notes, and snippets.

@dupuyjs
Last active March 4, 2016 17:25
Show Gist options
  • Save dupuyjs/4912cbd6dfa038210897 to your computer and use it in GitHub Desktop.
Save dupuyjs/4912cbd6dfa038210897 to your computer and use it in GitHub Desktop.
Visual Layer - Composition
#region Composition
SpriteVisual background = _compositor.CreateSpriteVisual();
background.Size = new Vector2(300.0f, 300.0f);
background.Offset = new Vector3(50.0f, 50.0f, 0.0f);
CompositionColorBrush indigo = _compositor.CreateColorBrush();
indigo.Color = Color.FromArgb(0xFF, 0x4B, 0x00, 0x82);
background.Brush = indigo;
root.Children.InsertAtTop(background);
SpriteVisual foreground = _compositor.CreateSpriteVisual();
foreground.Size = new Vector2(300.0f, 300.0f);
foreground.Offset = new Vector3(150.0f, 150.0f, 0.0f);
CompositionColorBrush cyan = _compositor.CreateColorBrush();
cyan.Color = Color.FromArgb(0xFF, 0x00, 0xFF, 0xFF);
foreground.Brush = cyan;
foreground.Opacity = 0.8f;
root.Children.InsertAtTop(foreground);
#endregion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment