I’ve looked at a dozen examples (and tried more than a few) and I can’t find a way to easily set up a RenderTargetBitmap or WriteableBitmap in WPF that can go on the Windows store.
Eventually I want to directly manipulate an array that I can blt on to the screen at 30 Hz or so.
This example has probably gotten me the closest:
DrawingVisual MyDrawingVisual = new DrawingVisual();
//Open its drawing context:
DrawingContext MyDC = MyDrawingVisual.RenderOpen();
// At this point you can draw
Pen p = new Pen();
p.Thickness = 5;
p.Brush = new SolidColorBrush(Colors.Green);
MyDC.DrawLine(p, new Point(1.0, 1.0), new Point(10.0, 10.0));
RenderTargetBitmap MyRenderTargetBitmap = new RenderTargetBitmap(100, 100, 96, 96, PixelFormats.Default);
MyRenderTargetBitmap.Render(MyDrawingVisual);
RenderTargetBitmap rtbm = new RenderTargetBitmap(200, 200, 96, 96, PixelFormats.Pbgra32);
rtbm.Render(MyCanvas);
The example above has 2 problems for me: it doesn’t seem to draw anything to the screen, and I think MyDC uses DirectX (which I guess doesn’t work with the Windows App Store).
EDIT:
This MS example is exactly what I was looking for!
Clemens was right up above. To me it seems like WPF and XAML are basically the same thing, but they aren’t.
My approach above was more or less stabbing around in the dark. I am going to try and use the tutorial as my starting point.
http://msdn.microsoft.com/en-us/library/windows/apps/hh986965.aspx