Skip to content

Instantly share code, notes, and snippets.

View robmikh's full-sized avatar

Robert Mikhayelyan robmikh

View GitHub Profile
@robmikh
robmikh / snippet.h
Last active October 9, 2022 04:26
Save textures in an ImageViewer compatible format
#include <unknwn.h>
#include <winrt/base.h>
#include <d3d11_4.h>
#include <filesystem>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <robmikh.common/d3dHelpers.h>
@robmikh
robmikh / CSFSVGTest.cs
Created November 24, 2018 20:45
CompositionSurfaceFactory SVG "plug-in" Concept
using Microsoft.Graphics.Canvas;
using Microsoft.Graphics.Canvas.Svg;
using Microsoft.Graphics.Canvas.UI.Composition;
using Robmikh.CompositionSurfaceFactory;
using System;
using System.Threading.Tasks;
using Windows.Foundation;
using Windows.Graphics.DirectX;
using Windows.Storage;
using Windows.UI;
@robmikh
robmikh / Animated MaskInvert
Last active September 6, 2017 13:21
Text MaskInvert
Compositor _compositor;
SurfaceFactory _surfaceFactory;
CompositionEffectFactory _effectFactory;
SpriteVisual _visual;
TextSurface _textSurface;
CompositionDrawingSurface _colorSurface;
_compositor = new Compositor();
@robmikh
robmikh / explanation.md
Last active June 18, 2020 02:10
On Framework-less Apps

So you can write an app using XAML, WinJS, and DirectX. But is there another option? There is! And it's actually what all of the other more traditional options do under the covers. At the end of the day, some Composition content needs to be hooked up to a CoreWindow. The first step is to create a main function that will start our CoreApplication:

static int Main(string[] args)
{
    CoreApplication.Run(/* Some IFrameworkViewSource here */);

    return 0;
}
@robmikh
robmikh / FlipViewIndicator.cs
Created June 21, 2016 06:17
Quick and dirty FlipView indicator using Composition+XAML
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.UI.Composition;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Documents;
@robmikh
robmikh / CompositionHelper.cs
Created April 6, 2016 22:31
Custom Image Control using Composition
using Robmikh.Util.CompositionImageLoader;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Composition;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Hosting;
@robmikh
robmikh / MainPage Excerpt
Created April 6, 2016 02:18
Using the InvertEffect with Windows.UI.Composition
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
InitComposition();
}
//